bool *invalid = (bool *) data;
bool ret_bool = true;
int min, max;
- char from[5] = { 0, };
- char to[3] = { 0, };
+ char *from = NULL;
+ char *to = NULL;
bool t_val;
char *val;
size_t size;
*invalid = true;
break;
case NODE_ATTR_SCREEN_DPI_RANGE:
- sscanf(val, "%s %d %s %d", from, &min, to, &max);
+ sscanf(val, "%ms %d %ms %d", &from, &min, &to, &max);
if (screen_dpi == -1)
screen_dpi = __get_dpi();
if (!(min <= screen_dpi && screen_dpi <= max))
*invalid = true;
+ if (from)
+ free(from);
+ if (to)
+ free(to);
break;
case NODE_ATTR_SCREEN_WIDTH_RANGE:
- sscanf(val, "%s %d %s %d", from, &min, to, &max);
+ sscanf(val, "%ms %d %ms %d", &from, &min, &to, &max);
if (screen_width == -1)
screen_width = __get_screen_width();
if (!(min <= screen_width && screen_width <= max))
*invalid = true;
+ if (from)
+ free(from);
+ if (to)
+ free(to);
break;
case NODE_ATTR_SCREEN_LARGE:
if (!(strcmp(val, "true")))