Re: [AD] pack_fgets returns wrong address |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> See this thread:
>
> http://www.allegro.cc/forums/view_thread.php?_id=247285
>
> 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.
The bug was introduced on 2001/05/07 !!
> In file.c, around line 2014:
>
> char *pmax, *buffer=p;
>
> And then on 2005:
>
> return buffer;
>
> Something like that does the trick.
Yep. Applied on trunk and branch.
--
Eric Botcazou