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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user