From 0dc43cbf916830e524ee705664bc9d1e1addaee2 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 27 Mar 2012 12:33:35 +0200 Subject: [PATCH] new: Improve the fix with the NULL-sentinel. With multiple sequence arguments on the command line you might end up with garbage in the sequence[] array (it needs the last argument to be a NULL. So do two things: make the first two arguments NULL, and as we add arguments to sequence[] make sure the list has a NULL on the end. This is another problem discovered by the nmh test suite. Pulled in from nmh. Thanks to Ken Hornstein. --- uip/new.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uip/new.c b/uip/new.c index f6ac364..dab17ad 100644 --- a/uip/new.c +++ b/uip/new.c @@ -433,6 +433,7 @@ main(int argc, char **argv) struct node *folder; sequences[0] = NULL; + sequences[1] = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); @@ -483,6 +484,7 @@ main(int argc, char **argv) /* have a sequence argument */ if (!seq_in_list(cp, sequences)) { sequences[i++] = cp; + sequences[i] = NULL; } } -- 1.7.10.4