File tree 1 file changed +4
-3
lines changed
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)
1299
1299
* don't treat something with a leading zero followed by another
1300
1300
* digit as numeric - could be a zip code or similar
1301
1301
*/
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 ])) &&
1303
1304
strspn (src -> data , "+-0123456789Ee." ) == src -> len )
1304
1305
{
1305
1306
/*
@@ -1308,7 +1309,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
1308
1309
*/
1309
1310
char * endptr = "junk" ;
1310
1311
1311
- (void ) ( strtol (src -> data , & endptr , 10 ) + 1 );
1312
+ (void ) strtol (src -> data , & endptr , 10 );
1312
1313
if (* endptr == '\0' )
1313
1314
{
1314
1315
/*
@@ -1320,7 +1321,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
1320
1321
else
1321
1322
{
1322
1323
/* not an int - try a double */
1323
- (void ) ( strtod (src -> data , & endptr ) + 1.0 );
1324
+ (void ) strtod (src -> data , & endptr );
1324
1325
if (* endptr == '\0' )
1325
1326
is_number = true;
1326
1327
}
You can’t perform that action at this time.
0 commit comments