strncpy copies the first n charactors of the string,
but does not terminate the output string. I think this
is a general problem, but I am using the "51 large"
version.
That has been the standard behaviour for a long time. From
MSDN (July 2001):
"The strncpy function copies the initial count characters
of strSource to strDest and returns strDest. If count is
less than or equal to the length of strSource, a null
character is not appended automatically to the copied
string..."
Just after copying, you can null terminate the string
yourself:
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Proposed revision
Logged In: YES
user_id=888171
Allthough that may be your expectation that is not what
the C99 standard prescribes in "7.21.2.4 The strncpy
function". Current behaviour is correct.
Logged In: YES
user_id=603650
That has been the standard behaviour for a long time. From
MSDN (July 2001):
"The strncpy function copies the initial count characters
of strSource to strDest and returns strDest. If count is
less than or equal to the length of strSource, a null
character is not appended automatically to the copied
string..."
Just after copying, you can null terminate the string
yourself:
strncpy( strDest, strSource, count );
strDest[count]=0;
Logged In: YES
user_id=1312539
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).