The 3 lines of code it replaced could, so why would you not believe asprintf() couldn't ?
2016-09-05 9:47 GMT+02:00 Ali H. Fardan <[email protected]>: > On 2016-09-05 10:44, David Gwynne wrote: > >> On 5 Sep 2016, at 17:39, Ali H. Fardan <[email protected]> wrote: >>> >>> and why is he telling me this? I just said if the destination is a >>> pointer to char, how would a function automagically allocate a size >>> for it? >>> >> >> its not a pointer to a char, its a pointer to a char pointer: >> >> as per the man page: >> >> int >> asprintf(char **ret, const char *format, ...); >> >> dlg >> >> > Still doesn't mean that it can automagically allocate a correct > buffer size. > > -- May the most significant bit of your life be positive.
