summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-09-17 21:18:47 +0900
committerHermet Park <hermetpark@gmail.com>2019-09-17 21:18:47 +0900
commit3932c6838292472b14f6dcfd90e74c59554c9524 (patch)
tree9f925a38c9e4a9d95a0cf13691b3cff0824a3744 /src/modules
parent4a60495d9122f7fa7f70a1650d6ee36fdc14e781 (diff)
evas_vg_load_svg: Change strtod to eina_convert_strtod_c for locale issue
Summary: Crash depending on LOCALE when using strtod. So change to eina_convert_strtod_c which is made to prevent strtod problem. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9988
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index c277ee9d26..97f87c7e96 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -84,7 +84,7 @@ _parse_number(const char **content, double *number)
84{ 84{
85 char *end = NULL; 85 char *end = NULL;
86 86
87 *number = strtod(*content, &end); 87 *number = eina_convert_strtod_c(*content, &end);
88 // if the start of string is not number 88 // if the start of string is not number
89 if ((*content) == end) return EINA_FALSE; 89 if ((*content) == end) return EINA_FALSE;
90 //skip comma if any 90 //skip comma if any
@@ -102,7 +102,7 @@ _parse_number(const char **content, double *number)
102static inline double 102static inline double
103_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Length_Type type) 103_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Length_Type type)
104{ 104{
105 double parsed_value = strtod(str, NULL); 105 double parsed_value = eina_convert_strtod_c(str, NULL);
106 106
107 if (strstr(str, "cm")) 107 if (strstr(str, "cm"))
108 parsed_value = parsed_value * 35.43307; 108 parsed_value = parsed_value * 35.43307;
@@ -141,7 +141,7 @@ _gradient_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Leng
141{ 141{
142 char *end = NULL; 142 char *end = NULL;
143 143
144 double parsed_value = strtod(str, &end); 144 double parsed_value = eina_convert_strtod_c(str, &end);
145 double max = 1; 145 double max = 1;
146 146
147 /** 147 /**
@@ -182,7 +182,7 @@ _to_offset(const char *str)
182{ 182{
183 char *end = NULL; 183 char *end = NULL;
184 184
185 double parsed_value = strtod(str, &end); 185 double parsed_value = eina_convert_strtod_c(str, &end);
186 186
187 if (strstr(str, "%")) 187 if (strstr(str, "%"))
188 parsed_value = parsed_value / 100.0; 188 parsed_value = parsed_value / 100.0;
@@ -195,7 +195,7 @@ _to_opacity(const char *str)
195{ 195{
196 char *end = NULL; 196 char *end = NULL;
197 int a = 0; 197 int a = 0;
198 double opacity = strtod(str, &end); 198 double opacity = eina_convert_strtod_c(str, &end);
199 199
200 if (*end == '\0') 200 if (*end == '\0')
201 a = lrint(opacity * 255); 201 a = lrint(opacity * 255);
@@ -277,7 +277,7 @@ _parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length)
277 { 277 {
278 // skip white space, comma 278 // skip white space, comma
279 str = _skipcomma(str); 279 str = _skipcomma(str);
280 tmp[count++] = strtod(str, &end); 280 tmp[count++] = eina_convert_strtod_c(str, &end);
281 str = _skipcomma(end); 281 str = _skipcomma(end);
282 } 282 }
283 283
@@ -337,7 +337,7 @@ _color_parser(const char *value, char **end)
337{ 337{
338 double r; 338 double r;
339 339
340 r = strtod(value + 4, end); 340 r = eina_convert_strtod_c(value + 4, end);
341 *end = _skip_space(*end, NULL); 341 *end = _skip_space(*end, NULL);
342 if (**end == '%') 342 if (**end == '%')
343 r = 255 * r / 100; 343 r = 255 * r / 100;
@@ -590,7 +590,7 @@ parse_numbers_array(char *str, double *points, int *pt_count)
590 *str == '+' || 590 *str == '+' ||
591 *str == '.') 591 *str == '.')
592 { 592 {
593 points[count++] = strtod(str, &end); 593 points[count++] = eina_convert_strtod_c(str, &end);
594 str = end; 594 str = end;
595 str = _skip_space(str, NULL); 595 str = _skip_space(str, NULL);
596 if (*str == ',') 596 if (*str == ',')
@@ -758,7 +758,7 @@ parse_length(const char *str, Svg_Length_Type *type)
758 { 758 {
759 *type = length_tags[i].type; 759 *type = length_tags[i].type;
760 } 760 }
761 value = strtod(str, NULL); 761 value = eina_convert_strtod_c(str, NULL);
762 return value; 762 return value;
763} 763}
764 764