summaryrefslogtreecommitdiff
path: root/src/core/special-vars.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-20 11:30:24 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-20 11:30:24 +0000
commit476b5ec863c49bb9a85eda23fbba31cf0d3a443c (patch)
tree0952437d5d69c845b4dbca33705bfc4b7ef71ccb /src/core/special-vars.c
parent75ebab8089aff9eb98e4451b56e95f5883d3d9f2 (diff)
downloadirssi-476b5ec863c49bb9a85eda23fbba31cf0d3a443c.zip
$~ crashed if arglist was empty
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1858 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/special-vars.c')
-rw-r--r--src/core/special-vars.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/special-vars.c b/src/core/special-vars.c
index 442342b6..4490139f 100644
--- a/src/core/special-vars.c
+++ b/src/core/special-vars.c
@@ -74,7 +74,7 @@ static char *get_argument(char **cmd, char **arglist)
}
str = g_string_new(NULL);
- while (arg < argcount && (arg <= max || max == -1)) {
+ while (arg >= 0 && arg < argcount && (arg <= max || max == -1)) {
g_string_append(str, arglist[arg]);
g_string_append_c(str, ' ');
arg++;