aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-11 20:33:46 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-11 20:33:46 +0000
commit2d6282bb37a4051e5beb10c70e1fb862eddeae1d (patch)
tree48c587218b2a2b021deccdfd66d487fcdff669ff
parentd323d32c5bba8e21bcd1e3df511f8d842a5d5457 (diff)
downloadbusybox-w32-2d6282bb37a4051e5beb10c70e1fb862eddeae1d.tar.gz
busybox-w32-2d6282bb37a4051e5beb10c70e1fb862eddeae1d.tar.bz2
busybox-w32-2d6282bb37a4051e5beb10c70e1fb862eddeae1d.zip
Matt Kraai pointed out that we can rely on strncpy to NULL
terminate shorter cases, so we can save a few cycles...
-rw-r--r--utility.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 22eaff075..5dbe253a4 100644
--- a/utility.c
+++ b/utility.c
@@ -931,8 +931,8 @@ unsigned long my_getid(const char *filename, char *name, long id, long *gid)
931 } 931 }
932 } 932 }
933 if (id != -1 && id == rid) { 933 if (id != -1 && id == rid) {
934 memset(name, 0, 9*sizeof(char));
935 strncpy(name, rname, 8); 934 strncpy(name, rname, 8);
935 name[8]='\0';
936 if (gid) *gid = rgid; 936 if (gid) *gid = rgid;
937 fclose(file); 937 fclose(file);
938 return (TRUE); 938 return (TRUE);