D
Default User
BobR said:Of course you are correct. My bad. (gads, I hate that phrase!!).
Thanks for the 'heads-up'.
It happens. Generally, strncpy() is a tricky and not overly useful
function. I usually, when doing this in C, try to use strncat(). That
requires initializing the target string first.
char target[4] = "";
char source[] = "abcdef";
strncat(target, source, 3);
That will give you a null-terminated string in target consisting of the
first three characters of source.
Brian