aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/win32/sys_float.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-09-07 15:21:13 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-09-07 17:01:08 +0200
commit32286d6523d0f46163f1c5e23253516d61c46c78 (patch)
tree6011f537893669d88523beedfc7eadc5040b739e /erts/emulator/sys/win32/sys_float.c
parent7bd69516a3cab79f869fde5787140ae810c35ef8 (diff)
downloadotp-32286d6523d0f46163f1c5e23253516d61c46c78.tar.gz
otp-32286d6523d0f46163f1c5e23253516d61c46c78.tar.bz2
otp-32286d6523d0f46163f1c5e23253516d61c46c78.zip
Replace sprintf with erts_snprintf in beam
Diffstat (limited to 'erts/emulator/sys/win32/sys_float.c')
-rw-r--r--erts/emulator/sys/win32/sys_float.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/sys/win32/sys_float.c b/erts/emulator/sys/win32/sys_float.c
index 6558ad2d99..09dad89140 100644
--- a/erts/emulator/sys/win32/sys_float.c
+++ b/erts/emulator/sys/win32/sys_float.c
@@ -118,18 +118,18 @@ sys_chars_to_double(char *buf, double *fp)
*/
int
-sys_double_to_chars(double fp, char *buf)
+sys_double_to_chars(double fp, char *buffer, size_t buffer_size)
{
- char *s = buf;
+ char *s = buffer;
- (void) sprintf(buf, "%.20e", fp);
+ (void) erts_snprintf(buffer, buffer_size, "%.20e", fp);
/* Search upto decimal point */
if (*s == '+' || *s == '-') s++;
while (isdigit(*s)) s++;
if (*s == ',') *s++ = '.'; /* Replace ',' with '.' */
/* Scan to end of string */
while (*s) s++;
- return s-buf; /* i.e strlen(buf) */
+ return s-buffer; /* i.e strlen(buffer) */
}
int