]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Unbreak group operations by reverting previous delta which removed the
authorDima Dorfman <dd@FreeBSD.org>
Thu, 30 Aug 2001 06:32:17 +0000 (06:32 +0000)
committerDima Dorfman <dd@FreeBSD.org>
Thu, 30 Aug 2001 06:32:17 +0000 (06:32 +0000)
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.

pw/grupd.c

index a2a028282c2752596df7d3bae71dfacc54ecb763..edff76d1285c88dda81cd015850bffa215e1dafc 100644 (file)
@@ -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