Hey Willy

On 12/7/15, 3:11 PM, "Willy Tarreau" <[email protected]> wrote:
>
>Yep, thanks for the pointer. So indeed gcc's inline version of strncpy
>*is*
>bogus. strncpy() has no right to guess the destination size.
>
>I suspect that if you just do this it would work (prefix the array with
>'&'
>and use [0] :
>
>   strncpy((char *)&s_kt->name.key[0], trash.str, i);
>
>Thanks,
>Willy

You would be correct in this guess :)

So what¹s the preference? Should I change it to use this weird version of
strcpy, or change it to memcpy?

-Dave


Reply via email to