On 27/06/13 13:25, Hans de Goede wrote: > Hi, > > <snip> > > A (v)snprintf return of -1 means that the output was truncated > (on some libc-s) throwing away the header if that got truncated > somehow is fine, but throwing away the log message is not.
I'd forgotten that some libc-s return -1 meaning truncation. The problem with that is that some other platforms might use -1 to mean parameter errors. For example, in rather contrived situations, Windows can return -1 on NULL buffer input. I see a couple of options: 1) Add a configure test and config.h variable for if -1 means truncation or not. 2) Just memset the buffer to zero right at the start and then make the change you suggest. I think the second is the easiest and most sensible option. Regards, Toby ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel