diff options
author | charnier <charnier@FreeBSD.org> | 2002-03-26 12:39:08 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 2002-03-26 12:39:08 +0000 |
commit | 86d3f6f7ce287bce795c388096171528a4b6d5d2 (patch) | |
tree | 2f21d0a1877b7042a8affde4f169eeea1287f5fb /usr.bin/gencat | |
parent | 6970613f93636814ed1bf0c9e67904da22f1b1df (diff) | |
download | FreeBSD-src-86d3f6f7ce287bce795c388096171528a4b6d5d2.zip FreeBSD-src-86d3f6f7ce287bce795c388096171528a4b6d5d2.tar.gz |
Add FBSDID. Spelling. Remove unused includes. Check more malloc failures.
Diffstat (limited to 'usr.bin/gencat')
-rw-r--r-- | usr.bin/gencat/gencat.c | 8 | ||||
-rw-r--r-- | usr.bin/gencat/gencat.h | 2 | ||||
-rw-r--r-- | usr.bin/gencat/genlib.c | 12 |
3 files changed, 12 insertions, 10 deletions
diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c index ead70d6..7826dfe 100644 --- a/usr.bin/gencat/gencat.c +++ b/usr.bin/gencat/gencat.c @@ -1,5 +1,3 @@ -/* $FreeBSD$ */ - /*********************************************************** Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. @@ -32,7 +30,9 @@ up-to-date. Many thanks. ******************************************************************/ -#include <sys/types.h> +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/file.h> #include <sys/stat.h> #include <err.h> @@ -46,7 +46,7 @@ up-to-date. Many thanks. * The spec says the syntax is "gencat catfile msgfile...". * We extend it to: * gencat [-lang C|C++|ANSIC] catfile msgfile [-h <header-file>]... - * Flags are order dependant, we'll take whatever lang was most recently chosen + * Flags are order dependent, we'll take whatever lang was most recently chosen * and use it to generate the next header file. The header files are generated * at the point in the command line they are listed. Thus the sequence: * gencat -lang C foo.cat foo.mcs -h foo.h -lang C++ bar.mcs -h bar.H diff --git a/usr.bin/gencat/gencat.h b/usr.bin/gencat/gencat.h index bf77b03..6e91cba 100644 --- a/usr.bin/gencat/gencat.h +++ b/usr.bin/gencat/gencat.h @@ -54,7 +54,7 @@ up-to-date. Many thanks. * My extension: If '#' is used instead of a number, the number * is generated automatically. A # followed by anything is an empty message. * $quote c - * Optional quote character which can suround message-text to + * Optional quote character which can surround message-text to * show where spaces are. * * Escape Characters diff --git a/usr.bin/gencat/genlib.c b/usr.bin/gencat/genlib.c index 185f2a0..8eaf39c 100644 --- a/usr.bin/gencat/genlib.c +++ b/usr.bin/gencat/genlib.c @@ -1,5 +1,3 @@ -/* $FreeBSD$ */ - /*********************************************************** Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. @@ -32,10 +30,11 @@ up-to-date. Many thanks. ******************************************************************/ -#include <sys/types.h> -#include <sys/file.h> -#include <err.h> +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <ctype.h> +#include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -112,6 +111,7 @@ getline(int fd) } if (cptr == cend) { cptr = curline = (char *) realloc(curline, curlen *= 2); + if (!curline) nomem(); cend = curline + curlen; } } @@ -169,6 +169,7 @@ getmsg(int fd, char *cptr, char quote) if (clen > msglen) { if (msglen) msg = (char *) realloc(msg, clen); else msg = (char *) malloc(clen); + if (!msg) nomem(); msglen = clen; } tptr = msg; @@ -192,6 +193,7 @@ getmsg(int fd, char *cptr, char quote) msglen += strlen(cptr); i = tptr - msg; msg = (char *) realloc(msg, msglen); + if (!msg) nomem(); tptr = msg + i; break; |