diff options
author | 2002-06-18 03:22:15 +0000 | |
---|---|---|
committer | 2002-06-18 03:22:15 +0000 | |
commit | 5f0c62e51d0000d63fe2110a036c0aad13e8544e (patch) | |
tree | 340707c57dc80b3215b111264d93f1ce72615366 | |
parent | add x flag for systraced processes; mentioned by christos@netbsd (diff) | |
download | wireguard-openbsd-5f0c62e51d0000d63fe2110a036c0aad13e8544e.tar.xz wireguard-openbsd-5f0c62e51d0000d63fe2110a036c0aad13e8544e.zip |
From bjh21@NetBSD:
- When open(2) fails, it returns -1, not NULL.
- When we're assigning to a long, use 0 rather than NULL.
-rw-r--r-- | usr.bin/fgen/fgen.l | 6 |
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) { |