projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d323d32
)
Matt Kraai pointed out that we can rely on strncpy to NULL
author
Eric Andersen
<andersen@codepoet.org>
Mon, 11 Dec 2000 20:33:46 +0000
(20:33 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Mon, 11 Dec 2000 20:33:46 +0000
(20:33 -0000)
terminate shorter cases, so we can save a few cycles...
utility.c
patch
|
blob
|
history
diff --git
a/utility.c
b/utility.c
index 22eaff075a33ff8ba1a9b5ea5598328d82264608..5dbe253a469f5cd90ac57b3576574ad5cdfc5a10 100644
(file)
--- a/
utility.c
+++ b/
utility.c
@@
-931,8
+931,8
@@
unsigned long my_getid(const char *filename, char *name, long id, long *gid)
}
}
if (id != -1 && id == rid) {
- memset(name, 0, 9*sizeof(char));
strncpy(name, rname, 8);
+ name[8]='\0';
if (gid) *gid = rgid;
fclose(file);
return (TRUE);