This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] libiberty/vasprintf.c bug
> > If ptr is NULL, shouldn't we add strlen("(null)") ?
>
> Yes. This will cause error.
> const char *p = NULL;
> int i = strlen (p);
I understand that. My question was, if you printf("%s", NULL), what
happens? If it prints "(null)", does that mean you need to account
for the length of that string in your calculations?
(also, note that libiberty patches go to gcc-patches@gcc.gnu.org, in
addition to any other lists who might be interested)