aboutsummaryrefslogtreecommitdiffstats
path: root/asm/pptok.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-02 19:28:13 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-02 19:36:41 -0700
commit841d904f88884f896735da1292e42615eaaea64f (patch)
tree141bb849caf87cb7387dd8e0f32d47348e7771a9 /asm/pptok.pl
parentdd535a6d19d73c31878e461304d326a4c8631843 (diff)
downloadnasm-841d904f88884f896735da1292e42615eaaea64f.tar.gz
nasm-841d904f88884f896735da1292e42615eaaea64f.tar.xz
nasm-841d904f88884f896735da1292e42615eaaea64f.zip
perl: change to the new, safer 3-operand form of open()
The 2-operand form was inherently unsafe. Use the 3-operand form instead, which guarantees that arbitrary filenames are supported. This also means we can remove a few instances of sysopen() which was used for exactly this reason, however, at least in theory sysopen() isn't portable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'asm/pptok.pl')
-rwxr-xr-xasm/pptok.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/asm/pptok.pl b/asm/pptok.pl
index 203332d6..41f5f9fc 100755
--- a/asm/pptok.pl
+++ b/asm/pptok.pl
@@ -43,7 +43,7 @@ my($what, $in, $out) = @ARGV;
#
# Read pptok.dat
#
-open(IN, "< $in") or die "$0: cannot open: $in\n";
+open(IN, '<', $in) or die "$0: cannot open: $in\n";
while (defined($line = <IN>)) {
$line =~ s/\r?\n$//; # Remove trailing \r\n or \n
$line =~ s/^\s+//; # Remove leading whitespace
@@ -86,7 +86,7 @@ foreach $ct (@cctok) {
$first_uncond = $pptok[0];
@pptok = (@cptok, @pptok);
-open(OUT, "> $out") or die "$0: cannot open: $out\n";
+open(OUT, '>', $out) or die "$0: cannot open: $out\n";
#
# Output pptok.h