From 2d6282bb37a4051e5beb10c70e1fb862eddeae1d Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 11 Dec 2000 20:33:46 +0000 Subject: [PATCH] Matt Kraai pointed out that we can rely on strncpy to NULL terminate shorter cases, so we can save a few cycles... --- utility.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility.c b/utility.c index 22eaff075..5dbe253a4 100644 --- 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); -- 2.25.1