Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2012-01-19 14:22:07 +0400
committerMark Pulford <mark@kyne.com.au>2012-03-04 12:24:35 +0400
commitbb296abe813f7ded82e74909fdb0f7e4f1f42416 (patch)
tree968a8ad91fe0692bf42621a8e58a8b7db828b0de
parentf62a3d368525b7b2d8f38b68178e1d277b247edf (diff)
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)
for(; decpt < 0; decpt++)
*b++ = '0';
while((*b++ = *s++));
+ b--;
}
else {
while((*b = *s++)) {