summaryrefslogtreecommitdiff
path: root/usr.bin/fgen
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-06-18 03:22:16 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-06-18 03:22:16 +0000
commit22c866adfe34488f89387f925a2701c7b797d175 (patch)
treec63b02faf31ff0d6413a6830db80b8e2edb766d6 /usr.bin/fgen
parent8ddce3db48ef689e0330f9c951c0b94418943a34 (diff)
From bjh21@NetBSD:
- When open(2) fails, it returns -1, not NULL. - When we're assigning to a long, use 0 rather than NULL.
Diffstat (limited to 'usr.bin/fgen')
-rw-r--r--usr.bin/fgen/fgen.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/fgen/fgen.l b/usr.bin/fgen/fgen.l
index afa6b411d85..414e38091fb 100644
--- a/usr.bin/fgen/fgen.l
+++ b/usr.bin/fgen/fgen.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: fgen.l,v 1.3 2002/06/11 05:58:27 nordin Exp $ */
+/* $OpenBSD: fgen.l,v 1.4 2002/06/18 03:22:15 jason Exp $ */
/* $NetBSD: fgen.l,v 1.12 2001/06/13 10:46:05 wiz Exp $ */
/* FLEX input for FORTH input file scanner */
/*
@@ -674,7 +674,7 @@ struct fcode fcodes[] = {
{ "xwflip", 0x0252 },
{ "xwflips", 0x0253 },
{ "xwsplit", 0x0254 },
- { NULL, NULL }
+ { NULL, 0 }
};
/*
@@ -1017,7 +1017,7 @@ main(argc, argv)
fheader->checksum += outbuf[i];
fheader->checksum = htons(fheader->checksum);
- if ((outf = open(outfile, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == NULL)
+ if ((outf = open(outfile, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
err(1, "can out open %s for writing", outfile);
if (write(outf, outbuf, outpos) != outpos) {