strncpy() is a terrible function: 1. If there is insufficient space, the resulting string will not be nul terminated. 2. If there is enough space, the remainder is filled with NULs. This can be painful if the target string is very big. Even if the characters stay in the ASCII range (0x7f and below), the resulting string will not be what you want. In the UTF-8 case it might be not nul-terminated and end in an invalid UTF-8 sequence. Best advice is to avoid strncpy(). EDIT: ad 1): #include #include int main (void) { char buff [4]; strncpy (buff, "hello world!\n", sizeof buff ); printf("%s\n", buff ); return 0; } Agreed, the buffer will not be overrun. But the result is still unwanted. strncpy() solves only part of the problem. It is misleading and unwanted. UPDATE(2012-10-31): Since this is a nasty problem, I decided to hack my own version, mimicking the ugly strncpy() behavior. The return value is the number of characters copied, though.. #include #include ...