Fix off by one error.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5529 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1999-03-12 15:17:08 +00:00
parent fedf5605f6
commit f2b691ad24

View File

@@ -57,8 +57,8 @@ error_message (long code)
if (p == NULL)
p = strerror(code);
if (p != NULL && *p != '\0') {
strncpy(msg, p, sizeof(msg));
msg[sizeof(msg)] = 0;
strncpy(msg, p, sizeof(msg) - 1);
msg[sizeof(msg) - 1] = 0;
} else
sprintf(msg, "Unknown error %ld", code);
return msg;