diff options
author | charnier <charnier@FreeBSD.org> | 2003-06-15 09:28:17 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 2003-06-15 09:28:17 +0000 |
commit | d46a4b84c36ffc40eac467a205717414ef8311c0 (patch) | |
tree | 8b645c361f8cd29562d33fc7a6cd5e073458ffaa /usr.bin/indent/args.c | |
parent | 7b4b7a670b84034ab40c33b9bdda786293e36dfe (diff) | |
download | FreeBSD-src-d46a4b84c36ffc40eac467a205717414ef8311c0.zip FreeBSD-src-d46a4b84c36ffc40eac467a205717414ef8311c0.tar.gz |
err() on allocation failure. WARNS=9 compliant
use #if 0, #ifndef lint, #endif /* not lint */, #endif ordering
when a message is provided, use errx() instead of err().
Diffstat (limited to 'usr.bin/indent/args.c')
-rw-r--r-- | usr.bin/indent/args.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c index 7998fc7..a8c4f9f 100644 --- a/usr.bin/indent/args.c +++ b/usr.bin/indent/args.c @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 +#ifndef lint static char sccsid[] = "@(#)args.c 8.1 (Berkeley) 6/6/93"; -#endif #endif /* not lint */ +#endif + #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -81,7 +82,7 @@ const char *option_source = "?"; * default value is the one actually assigned. */ struct pro { - const char *p_name; /* name, eg -bl, -cli */ + const char *p_name; /* name, e.g. -bl, -cli */ int p_type; /* type (int, bool, special) */ int p_default; /* the default value (if int) */ int p_special; /* depends on type */ @@ -268,6 +269,8 @@ found: goto need_param; { char *str = (char *) malloc(strlen(param_start) + 1); + if (str == NULL) + err(1, NULL); strcpy(str, param_start); addkey(str, 4); } |