Avoid array out of bound error.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2529 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Angus Salkeld 2009-10-14 23:05:18 +00:00
parent 765fa65351
commit 494bf45ebf

View File

@ -1457,7 +1457,7 @@ static char * pid_to_name (pid_t pid, char *out_name, size_t name_len)
/* copy the name */
strncpy (out_name, name, name_len);
out_name[name_len] = '\0';
out_name[name_len - 1] = '\0';
return out_name;
}