Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2003 - 2006 Pekka Riikonen
+ Copyright (C) 2003 - 2007 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
struct tm *time;
unsigned int msec = 0;
+ time_t timeval;
if (!ret_time)
return TRUE;
msec = time_val % 1000;
time_val /= 1000;
- time = localtime((time_t *)&time_val);
+ time = localtime(&timeval);
if (!time)
return FALSE;
+ time_val = timeval;
memset(ret_time, 0, sizeof(*ret_time));
if (!silc_time_fill(ret_time, time->tm_year + 1900, time->tm_mon + 1,
{
int ret, len = 0;
memset(ret_string, 0, ret_string_size);
- ret = silc_silc_snprintf(ret_string, ret_string_size - 1,
+ ret = silc_snprintf(ret_string, ret_string_size - 1,
"%02u%02u%02u%02u%02u%02u",
time_val->year % 100, time_val->month, time_val->day,
time_val->hour, time_val->minute, time_val->second);
len += ret;
if (!time_val->utc_hour && !time_val->utc_minute) {
- ret = silc_silc_snprintf(ret_string + len, ret_string_size - 1 - len, "Z");
+ ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len, "Z");
if (ret < 0)
return FALSE;
len += ret;
} else {
- ret = silc_silc_snprintf(ret_string + len, ret_string_size - 1 - len,
+ ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len,
"%c%02u%02u", time_val->utc_east ? '+' : '-',
time_val->utc_hour, time_val->utc_minute);
if (ret < 0)
{
int len = 0, ret;
memset(ret_string, 0, ret_string_size);
- ret = silc_silc_snprintf(ret_string, ret_string_size - 1,
+ ret = silc_snprintf(ret_string, ret_string_size - 1,
"%04u%02u%02u%02u%02u%02u",
time_val->year, time_val->month, time_val->day, time_val->hour,
time_val->minute, time_val->second);
len += ret;
if (time_val->msecond) {
- ret = silc_silc_snprintf(ret_string + len, ret_string_size - 1 - len,
+ ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len,
".%lu", (unsigned long)time_val->msecond);
if (ret < 0)
return FALSE;
}
if (!time_val->utc_hour && !time_val->utc_minute) {
- ret = silc_silc_snprintf(ret_string + len, ret_string_size - 1 - len, "Z");
+ ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len, "Z");
if (ret < 0)
return FALSE;
len += ret;
} else {
- ret = silc_silc_snprintf(ret_string + len, ret_string_size - 1 - len,
+ ret = silc_snprintf(ret_string + len, ret_string_size - 1 - len,
"%c%02u%02u", time_val->utc_east ? '+' : '-',
time_val->utc_hour, time_val->utc_minute);
if (ret < 0)