{
i18n_ucalendar_h ucal;
i18n_udate date;
+ char buf[BUF_SIZE] = {0, };
int ret = I18N_ERROR_NONE;
int year, month, day, hour, minute, second;
struct tm result;
- if (strlen(input_time) < 9) {
- strcat(input_time, "000000");
+ if (input_time) {
+ strncpy(buf, input_time, sizeof(buf)-1);
}
- strptime(input_time, "%Y%m%d%H%M%S", &result);
+
+ if (strlen(buf) < 9) {
+ strncat(buf, "000000", 6);
+ }
+ strptime(buf, "%Y%m%d%H%M%S", &result);
if (result.tm_year >= 100)
result.tm_year = result.tm_year % 100 + 2000;