summaryrefslogtreecommitdiff
path: root/ext/bcmath/libbcmath/src
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
committerMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
commit50ea26760da4e0fcf4980e739e1d0ed520de8d59 (patch)
tree888a32ce58864f5318a7f1072f8526c6a99212f9 /ext/bcmath/libbcmath/src
parent3e262bd36989898ac01224f0a987e79f44d25b31 (diff)
downloadphp-git-50ea26760da4e0fcf4980e739e1d0ed520de8d59.tar.gz
- Avoid sprintf, even when checked copy'n'paste or changes lead to errors
Diffstat (limited to 'ext/bcmath/libbcmath/src')
-rw-r--r--ext/bcmath/libbcmath/src/output.c2
-rw-r--r--ext/bcmath/libbcmath/src/rt.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c
index ab49b0e366..ad4e375467 100644
--- a/ext/bcmath/libbcmath/src/output.c
+++ b/ext/bcmath/libbcmath/src/output.c
@@ -71,7 +71,7 @@ bc_out_long (val, size, space, out_char)
int len, ix;
if (space) (*out_char) (' ');
- sprintf (digits, "%ld", val);
+ snprintf(digits, sizeof(digits), "%ld", val);
len = strlen (digits);
while (size > len)
{
diff --git a/ext/bcmath/libbcmath/src/rt.c b/ext/bcmath/libbcmath/src/rt.c
index 2479104fe4..d652021f89 100644
--- a/ext/bcmath/libbcmath/src/rt.c
+++ b/ext/bcmath/libbcmath/src/rt.c
@@ -45,7 +45,7 @@ void bc_rt_warn (char *mesg ,...)
char error_mesg [255];
va_start (args, mesg);
- vsprintf (error_mesg, mesg, args);
+ vsnprintf (error_mesg, sizeof(error_msg), mesg, args);
va_end (args);
fprintf (stderr, "bc math warning: %s\n", error_mesg);
@@ -58,7 +58,7 @@ void bc_rt_error (char *mesg ,...)
char error_mesg [255];
va_start (args, mesg);
- vsprintf (error_mesg, mesg, args);
+ vsnprintf (error_mesg, sizeof(error_msg), mesg, args);
va_end (args);
fprintf (stderr, "bc math error: %s\n", error_mesg);