diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-14 13:39:45 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-14 13:39:45 +0000 |
commit | 953cdb4a8c192dad24419e2faad15e31948e48a6 (patch) | |
tree | 9a2cf4468103a1713ddd6d81982704a4ac412d24 /sv.c | |
parent | bc3e8b6e7257ce0b7af7dcd5f3c2ff55a3b60ae3 (diff) | |
download | perl-953cdb4a8c192dad24419e2faad15e31948e48a6.tar.gz |
Followup on #19779: make the helper function static,
and rename it for paranoia reasons.
p4raw-id: //depot/perl@19781
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -8431,7 +8431,7 @@ Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, maybe_tainted); } -/* strnchr(): private function for use in sv_vcatpvfn() +/* my_strnchr(): private function for use in sv_vcatpvfn() * * Like strchr(), but allows to use strings that are not null-terminated. * The string length must be given instead and it _must_ be correct, as @@ -8439,8 +8439,9 @@ Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV * This would also allow to explicitly search for '\0' characters. */ -static const char * -strnchr(const char* s, int c, size_t n) +STATIC +const char * +S_my_strnchr(const char* s, int c, size_t n) { if (s) for (; n > 0; n--, s++) @@ -9351,7 +9352,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV /* to a null-terminated string. E.g. with the format "%-10c", eptr */ /* points to c (a single char on the stack), which makes strchr() */ /* run amok over the stack until it eventually hits '\n' or '\0'. */ - if (left && ckWARN(WARN_PRINTF) && strnchr(eptr, '\n', elen) && + if (left && ckWARN(WARN_PRINTF) && my_strnchr(eptr, '\n', elen) && (PL_op->op_type == OP_PRTF || PL_op->op_type == OP_SPRINTF)) Perl_warner(aTHX_ packWARN(WARN_PRINTF), "Newline in left-justified string for %sprintf", |