Changeset 8377
- Timestamp:
- May 11, 2009, 4:29:12 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5x/libtransmission/JSON_parser.c
r7664 r8377 55 55 #include <ctype.h> 56 56 #include <float.h> 57 #include <locale.h> 57 58 #include <stddef.h> 58 59 #include <stdio.h> … … 477 478 value.vu.str.length = jc->parse_buffer_count; 478 479 } else { 480 /* the json spec requires a '.' decimal point regardless of locale */ 481 char numeric[128]; 482 snprintf(numeric, sizeof(numeric), "%s", setlocale(LC_NUMERIC, NULL)); 483 setlocale(LC_NUMERIC, "POSIX" ); 479 484 sscanf(jc->parse_buffer, "%Lf", &value.vu.float_value); 485 value.vu.float_value = strtod(jc->parse_buffer, NULL); 486 setlocale(LC_NUMERIC, numeric); 480 487 } 481 488 break;
Note: See TracChangeset
for help on using the changeset viewer.