diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-10-28 14:55:51 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-10-28 14:55:51 +0100 |
commit | 78c355902e1a0b5d00b00232dc303775b06c6483 (patch) | |
tree | 65c59717af5bc626739d005ec18c6970ead20fac /toke.c | |
parent | d2b33dc14770aa6a2bf2bc3b18c63714a07b41f4 (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |