We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent4387cf9 commitc275499Copy full SHA for c275499
contrib/hstore/hstore_io.c
@@ -1299,7 +1299,8 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
1299
* don't treat something with a leading zero followed by another
1300
* digit as numeric - could be a zip code or similar
1301
*/
1302
-if (src->len>0&& (src->data[0]!='0'|| !isdigit(src->data[1]))&&
+if (src->len>0&&
1303
+!(src->data[0]=='0'&&isdigit((unsignedchar)src->data[1]))&&
1304
strspn(src->data,"+-0123456789Ee.")==src->len)
1305
{
1306
/*
@@ -1308,7 +1309,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
1308
1309
1310
char*endptr="junk";
1311
-(void)(strtol(src->data,&endptr,10)+1);
1312
+(void)strtol(src->data,&endptr,10);
1313
if (*endptr=='\0')
1314
1315
@@ -1320,7 +1321,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
1320
1321
else
1322
1323
/* not an int - try a double */
-(void)(strtod(src->data,&endptr)+1.0);
1324
+(void)strtod(src->data,&endptr);
1325
1326
is_number= true;
1327
}