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:
Eric Andersen 2000-12-11 20:33:46 +00:00
parent d323d32c5b
commit 2d6282bb37

View File

@ -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);