rem: sprintf(ctime_str,"%s",ctime(&tt));
add: snprintf(ctime_str,sizeof(ctime_str),"%s",ctime(&tt));
context: char* icaltime_as_ctime(struct icaltimetype t){    time_t tt;     tt = icaltime_as_timet(t);    sprintf(ctime_str,"%s",ctime(&tt));    ctime_str[strlen(ctime_str)-1] = 0;    return ctime_str;}