summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkstr/mkstr.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2002-04-12 13:08:00 +0000
committercharnier <charnier@FreeBSD.org>2002-04-12 13:08:00 +0000
commiteddee890415600dcbfacd7d1980e46a60cbc1979 (patch)
tree83b0b3eac3883d968424957e9b994ef3ef51bbd0 /usr.bin/mkstr/mkstr.c
parent2bdf833956ffe1975ab810bd7e40ee2b7548a2dd (diff)
downloadFreeBSD-src-eddee890415600dcbfacd7d1980e46a60cbc1979.zip
FreeBSD-src-eddee890415600dcbfacd7d1980e46a60cbc1979.tar.gz
Add FBSDID. Do not put spaces inside [] in usage string. Test memory allocation
return code. Correct and update C example in man page. Uppercase program name (.Nm) after a dot.
Diffstat (limited to 'usr.bin/mkstr/mkstr.c')
-rw-r--r--usr.bin/mkstr/mkstr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mkstr/mkstr.c b/usr.bin/mkstr/mkstr.c
index 2889cfd..fa526f2 100644
--- a/usr.bin/mkstr/mkstr.c
+++ b/usr.bin/mkstr/mkstr.c
@@ -41,10 +41,11 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)mkstr.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
@@ -128,7 +129,7 @@ main(argc, argv)
static void
usage()
{
- fprintf(stderr, "usage: mkstr [ - ] mesgfile prefix file ...\n");
+ fprintf(stderr, "usage: mkstr [-] mesgfile prefix file ...\n");
exit(1);
}
@@ -300,6 +301,8 @@ hashit(str, really, fakept)
}
if (!really || hp == 0) {
hp = (struct hash *) calloc(1, sizeof *hp);
+ if (hp == NULL)
+ err(1, NULL);
hp->hnext = bucket[i];
hp->hval = hashval;
hp->hpt = really ? ftell(mesgwrite) : fakept;
OpenPOWER on IntegriCloud