Use long instead of time_t in send_kline(), and cast time_t values to long in sping() when using %ld format.
This fixes bugs on netbsd i386, where time_t is longer than long. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@466 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -664,9 +664,11 @@ BUILT_IN_COMMAND(sping)
|
|||||||
#endif
|
#endif
|
||||||
if (!my_stricmp(sname, get_server_name(from_server)) || !my_stricmp(sname, get_server_itsname(from_server)))
|
if (!my_stricmp(sname, get_server_name(from_server)) || !my_stricmp(sname, get_server_itsname(from_server)))
|
||||||
#ifdef HAVE_GETTIMEOFDAY
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
send_to_server("PING LAG%ld.%ld :%s", tmp->in_sping.tv_sec, tmp->in_sping.tv_usec, sname);
|
send_to_server("PING LAG%ld.%ld :%s",
|
||||||
|
(long)tmp->in_sping.tv_sec, (long)tmp->in_sping.tv_usec,
|
||||||
|
sname);
|
||||||
#else
|
#else
|
||||||
send_to_server("PING LAG%ld :%s", now, sname);
|
send_to_server("PING LAG%ld :%s", (long)now, sname);
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
send_to_server("PING %s :%s",
|
send_to_server("PING %s :%s",
|
||||||
@@ -2738,11 +2740,9 @@ ChannelList *chan = NULL;
|
|||||||
|
|
||||||
BUILT_IN_COMMAND(send_kline)
|
BUILT_IN_COMMAND(send_kline)
|
||||||
{
|
{
|
||||||
char *dur,
|
char *dur, *target = NULL, *t;
|
||||||
*target = NULL,
|
long t_time = DEFAULT_TKLINE_TIME;
|
||||||
*t;
|
int tkline = 0;
|
||||||
time_t t_time = DEFAULT_TKLINE_TIME;
|
|
||||||
int tkline = 0;
|
|
||||||
|
|
||||||
if (*command == 'U')
|
if (*command == 'U')
|
||||||
{
|
{
|
||||||
@@ -2766,7 +2766,7 @@ BUILT_IN_COMMAND(send_kline)
|
|||||||
command++, tkline++;
|
command++, tkline++;
|
||||||
if (dur && is_number(dur))
|
if (dur && is_number(dur))
|
||||||
{
|
{
|
||||||
int l;
|
long l;
|
||||||
if ((l = my_atol(dur)))
|
if ((l = my_atol(dur)))
|
||||||
t_time = l;
|
t_time = l;
|
||||||
target = next_arg(args, &args);
|
target = next_arg(args, &args);
|
||||||
@@ -2786,7 +2786,7 @@ BUILT_IN_COMMAND(send_kline)
|
|||||||
{
|
{
|
||||||
if (!t || !*t) break;
|
if (!t || !*t) break;
|
||||||
if (tkline)
|
if (tkline)
|
||||||
send_to_server("%s %u %s :%s", command, t_time, t, args);
|
send_to_server("%s %ld %s :%s", command, t_time, t, args);
|
||||||
else
|
else
|
||||||
send_to_server("%s %s :%s", command, t, args);
|
send_to_server("%s %s :%s", command, t, args);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user