elm spinner - handle more digits for format string + handle invalid fmt

handles format strings like %0.234567f even tho before it was just %2f
- single digit after . ... not that it's useful handling more...

@fix
This commit is contained in:
Carsten Haitzler 2017-06-08 14:34:50 +09:00
parent cc0e17d32b
commit a772c54757
1 changed files with 7 additions and 2 deletions

View File

@ -430,7 +430,7 @@ _entry_value_apply(Evas_Object *obj)
static int
_decimal_points_get(const char *label)
{
char result[2] = "";
char result[16] = "0";
const char *start = strchr(label, '%');
while (start)
@ -447,7 +447,12 @@ _decimal_points_get(const char *label)
}
if (start)
sscanf(start, "%[^f]", result);
{
const char *p = strchr(start, 'f');
if ((p) && ((p - start) < 15))
sscanf(start, "%[^f]", result);
}
return atoi(result);
}