avoid compiler/linker warnings

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32483 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-07 11:34:17 +00:00
parent 695c2d279c
commit 96e48988fc
23 changed files with 271 additions and 167 deletions

View file

@ -1511,7 +1511,8 @@ NSUserName(void)
[gnustep_global_lock lock];
pwent = getpwuid (uid);
strcpy(buf, pwent->pw_name);
strncpy(buf, pwent->pw_name, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
[gnustep_global_lock unlock];
loginName = buf;
#endif /* HAVE_GETPWUID */