This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Typo fix in perlretut by Simon Taylor
[perl5.git] / regcomp.c
index 2c5ff0a..da245b1 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5863,7 +5863,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
        }
 
        if (o->flags & ANYOF_CLASS)
-           for (i = 0; i < sizeof(anyofs)/sizeof(char*); i++)
+           for (i = 0; i < (int)(sizeof(anyofs)/sizeof(char*)); i++)
                if (ANYOF_CLASS_TEST(o,i))
                    sv_catpv(sv, anyofs[i]);
 
@@ -6184,7 +6184,11 @@ Perl_save_re_context(pTHX)
            U32 i;
            for (i = 1; i <= rx->nparens; i++) {
                char digits[TYPE_CHARS(long)];
+#ifdef USE_SNPRINTF
+               const STRLEN len = snprintf(digits, sizeof(digits), "%lu", (long)i);
+#else
                const STRLEN len = my_sprintf(digits, "%lu", (long)i);
+#endif /* #ifdef USE_SNPRINTF */
                GV *const *const gvp
                    = (GV**)hv_fetch(PL_defstash, digits, len, 0);