On 2/25/10, Paolo Bonzini <pbonz...@redhat.com> wrote: > > - if (b) > > - sprintf(b, "..."); > > + if (b) { > > + memcpy(b, "...", sizeof("...")); > > + } > > > > What's wrong with strcpy? :-) (I doubt OpenBSD warns about that too).
But of course, with code containing strcpy() you get this: LINK i386-softmmu/qemu i386-dis.o(.text+0x3aac): In function `oappend': /src/qemu/i386-dis.c:4656: warning: strcpy() is almost always misused, p lease use strlcpy() /usr/X11R6/lib/libX11.so.11.2: warning: strcat() is almost always misuse d, please use strlcat() /usr/X11R6/lib/libX11.so.11.2: warning: sprintf() is often misused, plea se use snprintf() With clean code, the only warnings come from X11 libraries: LINK sparc64-softmmu/qemu-system-sparc64 /usr/X11R6/lib/libX11.so.11.2: warning: strcpy() is almost always misuse d, please use strlcpy() /usr/X11R6/lib/libX11.so.11.2: warning: strcat() is almost always misuse d, please use strlcat() /usr/X11R6/lib/libX11.so.11.2: warning: sprintf() is often misused, plea se use snprintf()