components/json-c/patches/0002-json_parse_int64.patch
author Neng Xue <neng.xue@oracle.com>
Fri, 14 Oct 2016 11:36:01 -0700
changeset 7111 a0e4f5518caa
parent 5890 e3686c085735
permissions -rw-r--r--
23500659 Setting ADIHEAP finds issues in GSS-API
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5890
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     1
Patch from https://github.com/json-c/json-c/issues/173 to workaround sscanf
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     2
compatibility issue that causes test failures with Solaris libc.
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     3
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     4
Need to investigate if we should update our libc sscanf to be more compatible.
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     5
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     6
--- json-c-0.12/json_util.c.~1~ 2014-04-11 04:41:08.000000000 +0400
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     7
+++ json-c-0.12/json_util.c     2015-03-15 14:49:17.934357502 +0300
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     8
@@ -221,7 +222,7 @@
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     9
 		// Skip leading zeros, but keep at least one digit
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    10
 		while (buf_sig_digits[0] == '0' && buf_sig_digits[1] != '\0')
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    11
 			buf_sig_digits++;
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    12
-		if (num64 == 0) // assume all sscanf impl's will parse -0 to 0
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    13
+		if (buf_sig_digits[0] == '0' && buf_sig_digits[1] == '\0') 
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    14
 			orig_has_neg = 0; // "-0" is the same as just plain "0"
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    15
 
e3686c085735 23169134 Move json-c library to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    16
 		snprintf(buf_cmp_start, sizeof(buf_cmp), "%" PRId64, num64);