int gmtoffset_hour = (pdata->tm_gmtoff) / 3600; /* result: hour */
int gmtoffset_min = ((pdata->tm_gmtoff) % 3600) / 60; /* result: min */
- snprintf(str_buf, size, "%+d:%02d", gmtoffset_hour, abs(gmtoffset_min));
+ int ret = snprintf(str_buf, size, "%+d:%02d", gmtoffset_hour, abs(gmtoffset_min));
+ if(ret >= size)
+ str_buf[size - 1] = '\0';
SETTING_TRACE_DEBUG("szTimezone is of a valid format: GMT: %s",
str_buf);
- int ret = vconf_set_str(VCONFKEY_SETAPPL_TIMEZONE_INT, str_buf);
+ ret = vconf_set_str(VCONFKEY_SETAPPL_TIMEZONE_INT, str_buf);
if (ret == -1)
SETTING_TRACE_ERROR("set vconf failed");
}