[Nasm-commits] [nasm:preproc-rewrite] macros.pl: added single-quote sanitizer to charcify subroutine, thanks Bryant Keller
nasm-bot for Keith Kanios
keith at kanios.net
Thu Jun 4 19:56:26 PDT 2020
Commit-ID: ab8573a185dce33c1e31259b1b828668585ad1d2
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=ab8573a185dce33c1e31259b1b828668585ad1d2
Author: Keith Kanios <keith at kanios.net>
AuthorDate: Sun, 1 Aug 2010 20:49:57 -0500
Committer: Keith Kanios <keith at kanios.net>
CommitDate: Sun, 1 Aug 2010 20:49:57 -0500
macros.pl: added single-quote sanitizer to charcify subroutine, thanks Bryant Keller
---
macros.pl | 2 ++
1 file changed, 2 insertions(+)
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
#
More information about the Nasm-commits
mailing list