summaryrefslogtreecommitdiff
path: root/printbuf.c
diff options
context:
space:
mode:
authorehaszla <ehaszla@327403b1-1117-474d-bef2-5cb71233fd97>2010-12-07 18:15:35 +0000
committerehaszla <ehaszla@327403b1-1117-474d-bef2-5cb71233fd97>2010-12-07 18:15:35 +0000
commit252669cee672b101cc43b2baae86db4a8bcb80eb (patch)
treef9735cbbf9703534b59e8c78b1881eb21cf583f4 /printbuf.c
parentf1ae67dbf0d5d921d2786cc63878dcc21e2a32ea (diff)
downloadjson-c-252669cee672b101cc43b2baae86db4a8bcb80eb.tar.gz
Simplify things by storing integer values only as int64_t's internally, and
omit the range check during parsing since we already have the checks when accessing the value. There is no longer a json_type_int64, only json_type_int. Fix some problems with parsing 0 and -0 values, and add a couple of tests. Fix some minor compile issues on HPUX environments. git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@60 327403b1-1117-474d-bef2-5cb71233fd97
Diffstat (limited to 'printbuf.c')
-rw-r--r--printbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/printbuf.c b/printbuf.c
index 97366c3..6ed1e94 100644
--- a/printbuf.c
+++ b/printbuf.c
@@ -123,7 +123,7 @@ int sprintbuf(struct printbuf *p, const char *msg, ...)
would have been written - this code handles both cases. */
if(size == -1 || size > 127) {
va_start(ap, msg);
- if((size = vasprintf(&t, msg, ap)) == -1) { va_end(ap); return -1; }
+ if((size = vasprintf(&t, msg, ap)) < 0) { va_end(ap); return -1; }
va_end(ap);
printbuf_memappend(p, t, size);
free(t);