openbsd-ports/net/bitchx/patches/patch-source_numbers_c

78 lines
2.3 KiB
Plaintext
Raw Normal View History

2009-03-24 17:43:09 -04:00
$OpenBSD: patch-source_numbers_c,v 1.3 2009/03/24 21:43:10 naddy Exp $
--- source/numbers.c.orig Mon Jan 8 07:24:22 2001
+++ source/numbers.c Tue Mar 24 22:41:56 2009
@@ -350,26 +350,29 @@ static void cannot_join_channel(char *from, char **Arg
set_display_target(chan, LOG_CURRENT);
PasteArgs(ArgList, 0);
- strcpy(buffer, ArgList[0]);
+ strlcpy(buffer, ArgList[0], sizeof buffer);
switch(-current_numeric)
{
case 437:
- strcat(buffer, " (Channel is temporarily unavailable)");
+ strlcat(buffer,
+ " (Channel is temporarily unavailable)",
+ sizeof buffer);
break;
case 471:
- strcat(buffer, " (Channel is full)");
+ strlcat(buffer, " (Channel is full)", sizeof buffer);
break;
case 473:
- strcat(buffer, " (You must be invited)");
+ strlcat(buffer, " (You must be invited)",
+ sizeof buffer);
break;
case 474:
- strcat(buffer, " (You are banned)");
+ strlcat(buffer, " (You are banned)", sizeof buffer);
break;
case 475:
- strcat(buffer, " (Bad channel key)");
+ strlcat(buffer, " (Bad channel key)", sizeof buffer);
break;
case 476:
- strcat(buffer, " (Bad channel mask)");
+ strlcat(buffer, " (Bad channel mask)", sizeof buffer);
break;
default:
return;
2009-03-24 17:43:09 -04:00
@@ -381,7 +384,6 @@ static void cannot_join_channel(char *from, char **Arg
reset_display_target();
}
-
int handle_server_stats(char *from, char **ArgList, int comm)
{
static int norm = 0,
2009-03-24 17:43:09 -04:00
@@ -1454,7 +1456,7 @@ void numbered_command(char *from, int comm, char **Arg
if (!ArgList[1] || !*ArgList[1])
break;
- sscanf(ArgList[1], "%lu", &tme);
+ sscanf(ArgList[1], "%d", &tme);
strcpy(this_sucks, ctime(&tme));
this_sucks[strlen(this_sucks)-1] = '\0';
2009-03-24 17:43:09 -04:00
@@ -1465,16 +1467,16 @@ void numbered_command(char *from, int comm, char **Arg
else
{
char cts[80], pts[80], ots[80];
- sscanf(ArgList[2], "%lu", &tme);
+ sscanf(ArgList[2], "%d", &tme);
strcpy(cts, ctime(&tme));
cts[strlen(cts)-1] = '\0';
- sscanf(ArgList[2], "%lu", &tme);
+ sscanf(ArgList[2], "%d", &tme);
strcpy(pts, ctime(&tme));
pts[strlen(pts)-1] = '\0';
ots[0] = 0;
if (ArgList[3])
{
- sscanf(ArgList[3], "%lu", &tme);
+ sscanf(ArgList[3], "%d", &tme);
strcpy(ots, ctime(&tme));
}
ots[strlen(ots)-1] = '\0';