Re: [Qemu-devel] [PATCHv3 11/20] ui/vnc: simplify and avoid strncpy

2012-10-04 Thread Peter Maydell
On 4 October 2012 19:56, Jim Meyering wrote: > Peter Maydell wrote: >> (Does the compiler really insist on that cast?) > > Yes. Without it, I get a warning/failure when char is signed. > See below. Ah yes, signed vs unsigned char. Thanks for the clarification. -- PMM

Re: [Qemu-devel] [PATCHv3 11/20] ui/vnc: simplify and avoid strncpy

2012-10-04 Thread Jim Meyering
Peter Maydell wrote: > On 4 October 2012 12:09, Jim Meyering wrote: >> From: Jim Meyering >> >> Don't bother with strncpy. There's no need for its zero-fill. >> Use g_strndup in place of g_malloc+strncpy+NUL-terminate. >> >> Signed-off-by: Jim Meyering >> --- >> ui/vnc-auth-sasl.c | 4 +--- >>

Re: [Qemu-devel] [PATCHv3 11/20] ui/vnc: simplify and avoid strncpy

2012-10-04 Thread Peter Maydell
On 4 October 2012 12:09, Jim Meyering wrote: > From: Jim Meyering > > Don't bother with strncpy. There's no need for its zero-fill. > Use g_strndup in place of g_malloc+strncpy+NUL-terminate. > > Signed-off-by: Jim Meyering > --- > ui/vnc-auth-sasl.c | 4 +--- > 1 file changed, 1 insertion(+),

[Qemu-devel] [PATCHv3 11/20] ui/vnc: simplify and avoid strncpy

2012-10-04 Thread Jim Meyering
From: Jim Meyering Don't bother with strncpy. There's no need for its zero-fill. Use g_strndup in place of g_malloc+strncpy+NUL-terminate. Signed-off-by: Jim Meyering --- ui/vnc-auth-sasl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth