diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-06-25 04:58:32 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-06-25 04:58:32 +0000 |
commit | bb8223788cfdbc45c4e8538b2567bb048f305a57 (patch) | |
tree | 94edf26dd08dc068c11311c981c1581399b2f447 /usr.bin/indent | |
parent | c0133c8efd4819d9e51e67bc7823a61a6588a7ac (diff) |
errx -> err if ENOMEM
Diffstat (limited to 'usr.bin/indent')
-rw-r--r-- | usr.bin/indent/args.c | 6 | ||||
-rw-r--r-- | usr.bin/indent/indent.c | 8 | ||||
-rw-r--r-- | usr.bin/indent/indent_globs.h | 10 | ||||
-rw-r--r-- | usr.bin/indent/lexi.c | 8 |
4 files changed, 16 insertions, 16 deletions
diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c index 8cab02c1cd7..fcdb807f6a1 100644 --- a/usr.bin/indent/args.c +++ b/usr.bin/indent/args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: args.c,v 1.6 2001/01/08 07:14:42 pjanzen Exp $ */ +/* $OpenBSD: args.c,v 1.7 2001/06/25 04:58:31 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #ifndef lint /*static char sccsid[] = "@(#)args.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: args.c,v 1.6 2001/01/08 07:14:42 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: args.c,v 1.7 2001/06/25 04:58:31 pjanzen Exp $"; #endif /* not lint */ /* @@ -287,7 +287,7 @@ found: { char *str; if ((str = strdup(param_start)) == NULL) - errx(1, "out of memory"); + err(1, NULL); addkey(str, 4); } break; diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index fa7e5f9267d..55e84599942 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: indent.c,v 1.9 2001/01/08 07:14:42 pjanzen Exp $ */ +/* $OpenBSD: indent.c,v 1.10 2001/06/25 04:58:31 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -47,7 +47,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";*/ -static char rcsid[] = "$OpenBSD: indent.c,v 1.9 2001/01/08 07:14:42 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: indent.c,v 1.10 2001/06/25 04:58:31 pjanzen Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -114,7 +114,7 @@ main(argc, argv) tokenbuf = (char *) malloc(bufsize); if (combuf == NULL || labbuf == NULL || codebuf == NULL || tokenbuf == NULL) - errx(1, "out of memory"); + err(1, NULL); l_com = combuf + bufsize - 5; l_lab = labbuf + bufsize - 5; l_code = codebuf + bufsize - 5; @@ -130,7 +130,7 @@ main(argc, argv) in_buffer = (char *) malloc(10); if (in_buffer == NULL) - errx(1, "out of memory"); + err(1, NULL); in_buffer_limit = in_buffer + 8; buf_ptr = buf_end = in_buffer; line_no = 1; diff --git a/usr.bin/indent/indent_globs.h b/usr.bin/indent/indent_globs.h index 636f6a5ff3e..34d6c57e9f1 100644 --- a/usr.bin/indent/indent_globs.h +++ b/usr.bin/indent/indent_globs.h @@ -1,4 +1,4 @@ -/* * $OpenBSD: indent_globs.h,v 1.5 2001/01/08 07:14:42 pjanzen Exp $*/ +/* * $OpenBSD: indent_globs.h,v 1.6 2001/06/25 04:58:31 pjanzen Exp $*/ /* * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 @@ -60,7 +60,7 @@ FILE *output; /* the output file */ register int nsize = l_code-s_code+400; \ codebuf = (char *) realloc(codebuf, nsize); \ if (codebuf == NULL) \ - errx(1, "out of memory"); \ + err(1, NULL); \ e_code = codebuf + (e_code-s_code) + 1; \ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ @@ -70,7 +70,7 @@ FILE *output; /* the output file */ register int nsize = l_com-s_com+400; \ combuf = (char *) realloc(combuf, nsize); \ if (combuf == NULL) \ - errx(1, "out of memory"); \ + err(1, NULL); \ e_com = combuf + (e_com-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ @@ -80,7 +80,7 @@ FILE *output; /* the output file */ register int nsize = l_lab-s_lab+400; \ labbuf = (char *) realloc(labbuf, nsize); \ if (labbuf == NULL) \ - errx(1, "out of memory"); \ + err(1, NULL); \ e_lab = labbuf + (e_lab-s_lab) + 1; \ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ @@ -90,7 +90,7 @@ FILE *output; /* the output file */ register int nsize = l_token-s_token+400; \ tokenbuf = (char *) realloc(tokenbuf, nsize); \ if (tokenbuf == NULL) \ - errx(1, "out of memory"); \ + err(1, NULL); \ e_token = tokenbuf + (e_token-s_token) + 1; \ l_token = tokenbuf + nsize - 5; \ s_token = tokenbuf + 1; \ diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index 71a3bab58c3..7717101f688 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lexi.c,v 1.7 2001/01/08 07:14:42 pjanzen Exp $ */ +/* $OpenBSD: lexi.c,v 1.8 2001/06/25 04:58:31 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #ifndef lint /*static char sccsid[] = "@(#)lexi.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: lexi.c,v 1.7 2001/01/08 07:14:42 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: lexi.c,v 1.8 2001/06/25 04:58:31 pjanzen Exp $"; #endif /* not lint */ /* @@ -590,13 +590,13 @@ addkey(key, val) maxspecials += maxspecials >> 2; specials = (struct templ *)malloc(maxspecials * sizeof specials[0]); if (specials == NULL) - errx(1, "out of memory"); + err(1, NULL); memmove(specials, specialsinit, sizeof specialsinit); } else if (nspecials >= maxspecials) { maxspecials += maxspecials >> 2; specials = realloc(specials, maxspecials * sizeof specials[0]); if (specials == NULL) - errx(1, "out of memory"); + err(1, NULL); } p = &specials[i]; |