mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
Matt Kraai pointed out that we can rely on strncpy to NULL
terminate shorter cases, so we can save a few cycles...
This commit is contained in:
parent
d323d32c5b
commit
2d6282bb37
@ -931,8 +931,8 @@ unsigned long my_getid(const char *filename, char *name, long id, long *gid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (id != -1 && id == rid) {
|
if (id != -1 && id == rid) {
|
||||||
memset(name, 0, 9*sizeof(char));
|
|
||||||
strncpy(name, rname, 8);
|
strncpy(name, rname, 8);
|
||||||
|
name[8]='\0';
|
||||||
if (gid) *gid = rgid;
|
if (gid) *gid = rgid;
|
||||||
fclose(file);
|
fclose(file);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
|
Loading…
Reference in New Issue
Block a user