qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] commit d354899 (Fix OpenBSD linker warning, 2010-02-23


From: Blue Swirl
Subject: Re: [Qemu-devel] commit d354899 (Fix OpenBSD linker warning, 2010-02-23)
Date: Thu, 25 Feb 2010 19:37:52 +0200

On 2/25/10, Paolo Bonzini <address@hidden> 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()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]