summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-10-28 14:55:51 +0100
committerNicholas Clark <nick@ccl4.org>2010-10-28 14:55:51 +0100
commit78c355902e1a0b5d00b00232dc303775b06c6483 (patch)
tree65c59717af5bc626739d005ec18c6970ead20fac /toke.c
parentd2b33dc14770aa6a2bf2bc3b18c63714a07b41f4 (diff)
downloadperl-78c355902e1a0b5d00b00232dc303775b06c6483.tar.gz
In S_scan_const(), use the return value of my_sprintf() to avoid a strlen().
Brought to you by the campaign for the elimination of strlen().
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index a30f60b6d5..64be92293d 100644
--- a/toke.c
+++ b/toke.c
@@ -3199,8 +3199,8 @@ S_scan_const(pTHX_ char *start)
/* Convert first code point to hex, including the
* boiler plate before it */
- sprintf(hex_string, "\\N{U+%X", (unsigned int) uv);
- output_length = strlen(hex_string);
+ output_length =
+ my_sprintf(hex_string, "\\N{U+%X", (unsigned int) uv);
/* Make sure there is enough space to hold it */
d = off + SvGROW(sv, off
@@ -3223,8 +3223,8 @@ S_scan_const(pTHX_ char *start)
uv = UNICODE_REPLACEMENT;
}
- sprintf(hex_string, ".%X", (unsigned int) uv);
- output_length = strlen(hex_string);
+ output_length =
+ my_sprintf(hex_string, ".%X", (unsigned int) uv);
d = off + SvGROW(sv, off
+ output_length