I'm writing a parser, and im totally confused. Its apparently correct, but something is happening:
I do a fread command to a char array of the entire file (it isn't big), this is the file:
but the buffer on the debug mode shows this:
it is repeating the two last lines, and the parser fails because it's waiting for an EOF or other simbol..
probably it isn't on the fread sentence, but here it is:
bufferdata size is 10.000
What could be happening?
Thanks.
I do a fread command to a char array of the entire file (it isn't big), this is the file:
Code:
sphere
{
center <-3,0,0>
radius 2
}
light
{
direction <1, 1, 1>
color rgb(1,1,1)
}
camera
{
parallel
position <1,0,0>
to <0,0,0>
up <0,1,0>
}
settings
{
image_width 800
image_height 600
min_weight 1
max_recursion_level 1
}
Code:
sphere
{
center <-3,0,0>
radius 2
}
light
{
direction <1, 1, 1>
color rgb(1,1,1)
}
camera
{
parallel
position <1,0,0>
to <0,0,0>
up <0,1,0>
}
settings
{
image_width 800
image_height 600
min_weight 1
max_recursion_level 1
}
max_recursion_level 1
}
probably it isn't on the fread sentence, but here it is:
Code:
fread(bufferdata, 1, 100000, fileIn); buffer = bufferdata;
What could be happening?
Thanks.
Comment