summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2017-10-17 17:30:18 +0100
committerAaron Crane <arc@cpan.org>2017-10-21 16:52:42 +0100
commit03f3961765f87fb8bccb4e3fa5b9e2e533d7dc30 (patch)
tree55b5dd025f714d184362ce7005c15fc15fdbc941
parent346712be0b77cf7a59cff19c5b96533d9a780268 (diff)
downloadperl-03f3961765f87fb8bccb4e3fa5b9e2e533d7dc30.tar.gz
Use snprintf() in favour of sprintf()
-rw-r--r--sv.c2
-rw-r--r--taint.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index c5a560a744..a3d33ae689 100644
--- a/sv.c
+++ b/sv.c
@@ -13210,7 +13210,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
? my_snprintf(PL_efloatbuf, PL_efloatsize, ptr, fv)
: my_snprintf(PL_efloatbuf, PL_efloatsize, ptr, (double)fv));
#else
- elen = my_sprintf(PL_efloatbuf, ptr, fv);
+ elen = my_snprintf(PL_efloatbuf, PL_efloatsize, ptr, fv);
#endif
GCC_DIAG_RESTORE;
}
diff --git a/taint.c b/taint.c
index 1b78928867..ae0c2c9d84 100644
--- a/taint.c
+++ b/taint.c
@@ -122,7 +122,7 @@ Perl_taint_env(pTHX)
while (1) {
MAGIC* mg;
if (i)
- len = my_sprintf(name,"DCL$PATH;%d", i);
+ len = my_snprintf(name, sizeof name, "DCL$PATH;%d", i);
svp = hv_fetch(GvHVn(PL_envgv), name, len, FALSE);
if (!svp || *svp == &PL_sv_undef)
break;