From d46a4b84c36ffc40eac467a205717414ef8311c0 Mon Sep 17 00:00:00 2001 From: charnier Date: Sun, 15 Jun 2003 09:28:17 +0000 Subject: 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(). --- usr.bin/indent/args.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin/indent/args.c') 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 __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); } -- cgit v1.1