1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Irssi::printformat() crashed if the registered format contained $0- etc.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2137 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-24 01:31:49 +00:00 committed by cras
parent 24015a360a
commit ea904f8dc9

View File

@ -122,13 +122,13 @@ printformat(level, format, ...)
PREINIT:
STRLEN n_a;
TEXT_DEST_REC dest;
char *arglist[MAX_FORMAT_PARAMS];
char *arglist[MAX_FORMAT_PARAMS+1];
int n;
CODE:
format_create_dest(&dest, NULL, NULL, level, NULL);
memset(arglist, 0, sizeof(arglist));
for (n = 2; n < 2+MAX_FORMAT_PARAMS; n++) {
arglist[n-2] = n < items ? SvPV(ST(n), n_a) : "";
for (n = 2; n < items && n < MAX_FORMAT_PARAMS-2; n++) {
arglist[n-2] = SvPV(ST(n), n_a);
}
printformat_perl(&dest, format, arglist);
@ -146,13 +146,13 @@ printformat(server, target, level, format, ...)
PREINIT:
STRLEN n_a;
TEXT_DEST_REC dest;
char *arglist[MAX_FORMAT_PARAMS];
char *arglist[MAX_FORMAT_PARAMS+1];
int n;
CODE:
format_create_dest(&dest, server, target, level, NULL);
memset(arglist, 0, sizeof(arglist));
for (n = 4; n < 4+MAX_FORMAT_PARAMS; n++) {
arglist[n-4] = n < items ? SvPV(ST(n), n_a) : "";
for (n = 4; n < items && n < MAX_FORMAT_PARAMS-4; n++) {
arglist[n-4] = SvPV(ST(n), n_a);
}
printformat_perl(&dest, format, arglist);
@ -169,13 +169,13 @@ printformat(window, level, format, ...)
PREINIT:
STRLEN n_a;
TEXT_DEST_REC dest;
char *arglist[MAX_FORMAT_PARAMS];
char *arglist[MAX_FORMAT_PARAMS+1];
int n;
CODE:
format_create_dest(&dest, NULL, NULL, level, window);
memset(arglist, 0, sizeof(arglist));
for (n = 3; n < 3+MAX_FORMAT_PARAMS; n++) {
arglist[n-3] = n < items ? SvPV(ST(n), n_a) : "";
for (n = 3; n < items && n < MAX_FORMAT_PARAMS-3; n++) {
arglist[n-3] = SvPV(ST(n), n_a);
}
printformat_perl(&dest, format, arglist);
@ -192,13 +192,13 @@ printformat(item, level, format, ...)
PREINIT:
STRLEN n_a;
TEXT_DEST_REC dest;
char *arglist[MAX_FORMAT_PARAMS];
char *arglist[MAX_FORMAT_PARAMS+1];
int n;
CODE:
format_create_dest(&dest, item->server, item->name, level, NULL);
memset(arglist, 0, sizeof(arglist));
for (n = 3; n < 3+MAX_FORMAT_PARAMS; n++) {
arglist[n-3] = n < items ? SvPV(ST(n), n_a) : "";
for (n = 3; n < items && n < MAX_FORMAT_PARAMS-3; n++) {
arglist[n-3] = SvPV(ST(n), n_a);
}
printformat_perl(&dest, format, arglist);