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: -
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
-
}
-
but the buffer on the debug mode shows this: -
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
-
}
-
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: -
fread(bufferdata, 1, 100000, fileIn);
-
buffer = bufferdata;
-
bufferdata size is 10.000
What could be happening?
Thanks.
1 2217
Nevermind, after almost 9 searches on google i found the answer..
fread won't append /0 to the end of the buffer it read, so i put it manually there, using the fread return value and it's working fine.
edit:
if any mod want to delete this one, you can do it. Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Wayno |
last post by:
My php logs are coming up empty. I have done all I can think of, and
all that made sense to me. Can someone take a look at my php.ini
please and tell me what you think may be the problem.
I...
|
by: Don Stevic |
last post by:
I am running VS2005 and using VSTO for Word.
I keep getting this error saying that there is no source code available for
this location when I try and run this application.
I am going to...
|
by: Peter Frost |
last post by:
Please help
I don't know if this is possible but what I would really like to do is
to use On Error Goto to capture the code that is being executed when
an error occurs.
Any help would be much...
|
by: Keith Kowalski |
last post by:
I anm opening up a text file reading the lines of the file that refer to a
tif image in that file, If the tif image does not exist I need it to send an
email stating that the file doesn't exist...
|
by: SQLJunkie |
last post by:
Hi,
I have installed SQL 2005 RTM on a new server and I keep getting this
error (described below) quite frequently. Was wondering if anyone has a
clue on what's happening here. I tried googling...
|
by: David Lozzi |
last post by:
Howdy,
I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders!
Now I am making a public function that will take the...
|
by: soup_nazi |
last post by:
I want to remove duplicate entries within a text file. So if I had
this within a text file...
Applications/Diabetic Registry/
Applications/Diabetic Registry/
Applications/Diabetic Registry/...
|
by: jason_cuteboy |
last post by:
Hi all,
Completely new to Vb.net and trying to create a simple VB Office Excel
application/spreadsheet. When I built the project, and excel opens up
an error comes up.... Customization assembly...
|
by: Steve Ametjan |
last post by:
I've been trying to get MySQL-python to install on Leopard for the
past couple of days, and I keep running into relatively the same
error. I'm hoping that someone on this list will be able to...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |