summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Kanios <keith@kanios.net>2010-08-01 20:49:57 -0500
committerKeith Kanios <keith@kanios.net>2010-08-01 20:49:57 -0500
commitab8573a185dce33c1e31259b1b828668585ad1d2 (patch)
treecc911c4cd86c9660b8a8ba1d4c236f385a8daece
parent091cce678e31abb7ab393d98a3e0f64f4865a9c7 (diff)
downloadnasm-ab8573a185dce33c1e31259b1b828668585ad1d2.tar.gz
macros.pl: added single-quote sanitizer to charcify subroutine, thanks Bryant Keller
-rwxr-xr-xmacros.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/macros.pl b/macros.pl
index 911da8db..14524ec8 100755
--- a/macros.pl
+++ b/macros.pl
@@ -57,12 +57,14 @@ sub charcify(@) {
if ($o < 32 || $o > 126 || $c eq '"' || $c eq "\\") {
$l .= sprintf("%3d,", $o);
} else {
+ $c =~ s/\'/\\'/; # << sanitize single quote.
$l .= "\'".$c."\',";
}
}
return $l;
}
+
#
# Generate macros.c
#