View Single Post
Old 01-12-2003, 10:40 PM   #1
visko
Member
 
Join Date: May 2002
Posts: 98
visko is on a distinguished road
Send a message via ICQ to visko Send a message via AIM to visko
I'm restructuring OLC a bit, and in the process I've created a new editor type, which I'm putting into a new .are file. The problem is, I'm getting very odd error messages from bug, to the tune of "Can't find the corrent information from line 0 of your file." This is true because there IS no line 0 of that file. Any reason this code would be looking for line 0 instead of line 1 to start out with? Are there any other things wrong with the code that I can't see because I'm blind?
--------------------------------------------
void load_segments( FILE *fp )
{
SEG_DATA *pSeg;
char *word, line[128];
int i, j;
fgets(line, sizeof(line), fp);
word = fread_word(fp);
if (!str_cmp(word, "Segments"))
i = fread_number(fp);
else
bug("ERROR: Number of Segments not defined.", 0);
for (j = 0; j < i; j++)
{
pSeg = alloc_perm(sizeof(pSeg));
pSeg->vnum = j;
pSeg->name = fread_string(fp);
pSeg->builders = fread_string(fp);
pSeg->seg_flags = fread_number(fp);
pSeg->credit = fread_string(fp);
}
fclose(fp);
}
-----------
I should be adding to this function, especially since this'll end up a linked list, but for now since I only have one segment, wth?
-Visko
visko is offline   Reply With Quote