Add FBSDID. Spelling. Remove unused includes. Check more malloc failures.

This commit is contained in:
Philippe Charnier 2002-03-26 12:39:08 +00:00
parent d74e4cbc8f
commit 3a8d2936c6
3 changed files with 12 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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;