[AD] pack_fgets returns wrong address

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]

See this thread:


According to the source comments:

"Returns a pointer to where it stored the text, or NULL on error"

But it doesn't, it returns pointer+strlen(pointer), due to 'p' being incremented.

In file.c, around line 2014:

  char *pmax, *buffer=p;

And then on 2005:

  return buffer;

Something like that does the trick.

Matthew Leverton - matthew@xxxxxxxxxx

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/