summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-13 01:52:39 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-13 01:52:39 +0000
commitbd193a42a5624f0a72b5f99d554e9a8d2afc64cc (patch)
tree7aacebe98730fbfee623943425a100fd158ba48a /utility.c
parent77508b29fa63d99136fc09f00c5a2addd6331b4c (diff)
downloadbusybox-w32-bd193a42a5624f0a72b5f99d554e9a8d2afc64cc.tar.gz
busybox-w32-bd193a42a5624f0a72b5f99d554e9a8d2afc64cc.tar.bz2
busybox-w32-bd193a42a5624f0a72b5f99d554e9a8d2afc64cc.zip
Fix from Matt Kraai -- a better way to NULL terminate strings for the
my_* passwd and group routines. I should have thought of doing it this way...
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index 0e170d1c1..61e5f7a73 100644
--- a/utility.c
+++ b/utility.c
@@ -957,12 +957,14 @@ long my_getgrnam(char *name)
957/* gets a username given a uid */ 957/* gets a username given a uid */
958void my_getpwuid(char *name, long uid) 958void my_getpwuid(char *name, long uid)
959{ 959{
960 name[0] = '\0';
960 my_getid("/etc/passwd", name, uid, NULL); 961 my_getid("/etc/passwd", name, uid, NULL);
961} 962}
962 963
963/* gets a groupname given a gid */ 964/* gets a groupname given a gid */
964void my_getgrgid(char *group, long gid) 965void my_getgrgid(char *group, long gid)
965{ 966{
967 group[0] = '\0';
966 my_getid("/etc/group", group, gid, NULL); 968 my_getid("/etc/group", group, gid, NULL);
967} 969}
968 970