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