summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-09 09:43:16 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-09 09:43:16 -0700
commitd4ca24338b944a0334deba8eb65a2621f2bc6afd (patch)
treeeb00dd33ef5202de6af6fafaca6235f69c233151
parentc357381da4b63eb50f5e133066fb72838b4b6ddf (diff)
downloadnasm-d4ca24338b944a0334deba8eb65a2621f2bc6afd.tar.gz
macros.pl: be a bit more careful with open()
Be a bit more strict with open() calls. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rwxr-xr-xmacros.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/macros.pl b/macros.pl
index b1970cf5..165d09f7 100755
--- a/macros.pl
+++ b/macros.pl
@@ -37,7 +37,7 @@ sub charcify(@) {
#
# Generate macros.c
#
-open(OUT,">macros.c") or die "unable to open macros.c\n";
+open(OUT,"> macros.c\0") or die "unable to open macros.c\n";
print OUT "/*\n";
print OUT " * Do not edit - this file auto-generated by macros.pl from:\n";
@@ -60,7 +60,7 @@ my $lastname;
my $z;
foreach $fname ( @ARGV ) {
- open(INPUT,$fname) or die "unable to open $fname\n";
+ open(INPUT,"< $fname\0") or die "$0: $fname: $!\n";
while (<INPUT>) {
$line++;
chomp;