This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]