summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zwgc/exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/zwgc/exec.c b/zwgc/exec.c
index 5c123ed..efae0a1 100644
--- a/zwgc/exec.c
+++ b/zwgc/exec.c
@@ -455,7 +455,10 @@ void exec_process_packet(program, notice)
var_set_number_variables_to_fields(notice_fields, notice_fields_length);
- number_of_fields = count_nulls(notice_fields, notice_fields_length);
+ number_of_fields = count_nulls(notice_fields, notice_fields_length)+1;
+ /* workaround for bug in old zwrite */
+ if (notice_fields[notice_fields_length-1] == '\0')
+ number_of_fields--;
var_set_variable_to_number("number_of_fields", number_of_fields);
clear_buffer();