1 Index: MilkdropPresetFactory/Parser.cpp
2 ===================================================================
3 --- MilkdropPresetFactory/Parser.cpp (revision 1510)
4 +++ MilkdropPresetFactory/Parser.cpp (working copy)
5 @@ -1269,28 +1269,13 @@
6 /* Parses a floating point number */
7 int Parser::string_to_float(char * string, float * float_ptr)
9 + std::istringstream stream(string);
10 + stream >> *float_ptr;
16 return PROJECTM_PARSE_ERROR;
18 - error_ptr = (char**)wipemalloc(sizeof(char**));
20 - (*float_ptr) = strtod(string, error_ptr);
22 - /* These imply a succesful parse of the string */
23 - if ((**error_ptr == '\0') || (**error_ptr == '\r'))
27 - return PROJECTM_SUCCESS;
33 - return PROJECTM_PARSE_ERROR;
34 + return PROJECTM_SUCCESS;
37 /* Parses a floating point number */
38 @@ -1298,11 +1283,9 @@
41 char string[MAX_TOKEN_SIZE];
46 - error_ptr =(char**) wipemalloc(sizeof(char**));
48 token = parseToken(fs, string);
50 @@ -1322,28 +1305,13 @@
56 return PROJECTM_PARSE_ERROR;
59 - (*float_ptr) = sign*strtod(string, error_ptr);
60 + std::istringstream stream(string);
61 + stream >> *float_ptr;
63 - /* No conversion was performed */
64 - if ((**error_ptr == '\0') || (**error_ptr == '\r'))
68 - return PROJECTM_SUCCESS;
71 - if (PARSE_DEBUG) printf("parse_float: float conversion failed for string \"%s\"\n", string);
76 - return PROJECTM_PARSE_ERROR;
78 + return PROJECTM_SUCCESS;
81 /* Parses a per frame equation. That is, interprets a stream of data as a per frame equation */