chkgrp.c (50479) | chkgrp.c (61019) |
---|---|
1/*- 2 * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#ifndef lint 30static const char rcsid[] = | 1/*- 2 * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#ifndef lint 30static const char rcsid[] = |
31 "$FreeBSD: head/usr.sbin/chkgrp/chkgrp.c 50479 1999-08-28 01:35:59Z peter $"; | 31 "$FreeBSD: head/usr.sbin/chkgrp/chkgrp.c 61019 2000-05-28 14:57:49Z charnier $"; |
32#endif /* not lint */ 33 34#include <err.h> 35#include <ctype.h> 36#include <stdio.h> 37#include <string.h> 38#include <sysexits.h> 39 --- 22 unchanged lines hidden (view full) --- 62 break; 63 default: 64 gfn = NULL; /* silence compiler */ 65 usage(); 66 } 67 68 /* open group file */ 69 if ((gf = fopen(gfn, "r")) == NULL) | 32#endif /* not lint */ 33 34#include <err.h> 35#include <ctype.h> 36#include <stdio.h> 37#include <string.h> 38#include <sysexits.h> 39 --- 22 unchanged lines hidden (view full) --- 62 break; 63 default: 64 gfn = NULL; /* silence compiler */ 65 usage(); 66 } 67 68 /* open group file */ 69 if ((gf = fopen(gfn, "r")) == NULL) |
70 err(EX_IOERR, gfn); /* XXX - is IO_ERR the correct exit code? */ | 70 err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ |
71 72 /* check line by line */ 73 while (++n) { 74 if ((line = fgetln(gf, &len)) == NULL) 75 break; 76 while (len && isspace(line[len-1])) 77 len--; 78 --- 63 unchanged lines hidden --- | 71 72 /* check line by line */ 73 while (++n) { 74 if ((line = fgetln(gf, &len)) == NULL) 75 break; 76 while (len && isspace(line[len-1])) 77 len--; 78 --- 63 unchanged lines hidden --- |