From 912e37823248cdc7f1e3aaff18327b771aa0d1bf Mon Sep 17 00:00:00 2001
From: Dima Dorfman
Date: Thu, 30 Aug 2001 06:32:17 +0000
Subject: [PATCH] Unbreak group operations by reverting previous delta which
removed the assignment of `l' in `gr_update' to the return value of snprintf.
It claimed to have fixed the case where snprintf returned -1--in fact, it
broke the entire routine. Not setting `l' here causes fileupdate() to
invariably fail with EINVAL because it does its own check to assert that the
parameter isn't -1.
---
usr.sbin/pw/grupd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.sbin/pw/grupd.c b/usr.sbin/pw/grupd.c
index a2a028282c27..edff76d1285c 100644
--- a/usr.sbin/pw/grupd.c
+++ b/usr.sbin/pw/grupd.c
@@ -134,7 +134,7 @@ gr_update(struct group * grp, char const * group, int mode)
char *grbuf = NULL;
ENDGRENT();
- snprintf(pfx, sizeof pfx, "%s:", group);
+ l = snprintf(pfx, sizeof pfx, "%s:", group);
/*
* Update the group file