aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2012-01-19 20:52:07 +1030
committerMark Pulford <mark@kyne.com.au>2012-03-04 18:54:35 +1030
commitbb296abe813f7ded82e74909fdb0f7e4f1f42416 (patch)
tree968a8ad91fe0692bf42621a8e58a8b7db828b0de
parentf62a3d368525b7b2d8f38b68178e1d277b247edf (diff)
downloadlua-cjson-bb296abe813f7ded82e74909fdb0f7e4f1f42416.tar.gz
lua-cjson-bb296abe813f7ded82e74909fdb0f7e4f1f42416.tar.bz2
lua-cjson-bb296abe813f7ded82e74909fdb0f7e4f1f42416.zip
Fix string length returned by g_fmt.c for |x|<1
Fix string length returned by built in fpconv_g_fmt() so it doesn't include the trailing null when converting numbers |x|<1.
-rw-r--r--g_fmt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/g_fmt.c b/g_fmt.c
index 130dcd4..50d6a1d 100644
--- a/g_fmt.c
+++ b/g_fmt.c
@@ -90,6 +90,7 @@ fpconv_g_fmt(char *b, double x, int precision)
90 for(; decpt < 0; decpt++) 90 for(; decpt < 0; decpt++)
91 *b++ = '0'; 91 *b++ = '0';
92 while((*b++ = *s++)); 92 while((*b++ = *s++));
93 b--;
93 } 94 }
94 else { 95 else {
95 while((*b = *s++)) { 96 while((*b = *s++)) {