Matt Kraai pointed out that we can rely on strncpy to NULL
authorEric Andersen <andersen@codepoet.org>
Mon, 11 Dec 2000 20:33:46 +0000 (20:33 -0000)
committerEric 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

index 22eaff0..5dbe253 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);