aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-02-05 15:50:24 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-02-05 15:50:24 -0200
commit5e8c162b6cb238ecfc22c105f7577a47c327f307 (patch)
tree6f35d1af9219c750a6762f3528156ba9c7509607 /lstrlib.c
parentc8d6cb01365780367f949a94b29bb3f043744c0e (diff)
downloadlua-5e8c162b6cb238ecfc22c105f7577a47c327f307.tar.gz
lua-5e8c162b6cb238ecfc22c105f7577a47c327f307.tar.bz2
lua-5e8c162b6cb238ecfc22c105f7577a47c327f307.zip
detail
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index ac5793b0..830699bd 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.222 2015/01/13 17:18:25 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.224 2015/02/04 12:54:31 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -835,7 +835,7 @@ static int num2straux (char *buff, lua_Number x) {
835 return sprintf(buff, LUA_NUMBER_FMT, x); /* equal to '%g' */ 835 return sprintf(buff, LUA_NUMBER_FMT, x); /* equal to '%g' */
836 else if (x == 0) { /* can be -0... */ 836 else if (x == 0) { /* can be -0... */
837 sprintf(buff, LUA_NUMBER_FMT, x); 837 sprintf(buff, LUA_NUMBER_FMT, x);
838 strcpy(buff + (buff[0] == '-' ? 1 : 0), "0x0p+0"); 838 strcat(buff, "x0p+0"); /* reuses '0/-0' from 'sprintf'... */
839 return strlen(buff); 839 return strlen(buff);
840 } 840 }
841 else { 841 else {