File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1299,7 +1299,8 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
12991299 * don't treat something with a leading zero followed by another
13001300 * digit as numeric - could be a zip code or similar
13011301 */
1302- if (src -> len > 0 && (src -> data [0 ] != '0' || !isdigit (src -> data [1 ])) &&
1302+ if (src -> len > 0 &&
1303+ !(src -> data [0 ] == '0' && isdigit ((unsigned char ) src -> data [1 ])) &&
13031304 strspn (src -> data , "+-0123456789Ee." ) == src -> len )
13041305 {
13051306 /*
@@ -1308,7 +1309,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
13081309 */
13091310 char * endptr = "junk" ;
13101311
1311- (void ) ( strtol (src -> data , & endptr , 10 ) + 1 );
1312+ (void ) strtol (src -> data , & endptr , 10 );
13121313 if (* endptr == '\0' )
13131314 {
13141315 /*
@@ -1320,7 +1321,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
13201321 else
13211322 {
13221323 /* not an int - try a double */
1323- (void ) ( strtod (src -> data , & endptr ) + 1.0 );
1324+ (void ) strtod (src -> data , & endptr );
13241325 if (* endptr == '\0' )
13251326 is_number = true;
13261327 }
You can’t perform that action at this time.
0 commit comments