summaryrefslogtreecommitdiff
path: root/pico/search.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-05-08 09:12:03 -0600
committerEduardo Chappa <chappa@washington.edu>2015-05-08 09:12:03 -0600
commit78cdd43ac7f0b6b14dddc0a539f50bf2609ebfa5 (patch)
treeaabefe2bc16da03777e69e85718cf62aaaf4db66 /pico/search.c
parent21aedc404d8e1bf637e810ee521e99472b1e1287 (diff)
downloadalpine-78cdd43ac7f0b6b14dddc0a539f50bf2609ebfa5.tar.xz
* Crash: Pico would crash when a search and replace was requested. The
problem was that the menu must have size 10, even if not all items are used, and in this case, it had size 2, making the routines that process menu items crash. * The feature Scramble the Message-ID When Sending will also scramble the name, version and operative system in the message-id header. Based on a contribution by Dennis Davis, which is itself based on a contribution by Mark Hills.
Diffstat (limited to 'pico/search.c')
-rw-r--r--pico/search.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pico/search.c b/pico/search.c
index 1aae21cf..5a1a1359 100644
--- a/pico/search.c
+++ b/pico/search.c
@@ -463,13 +463,13 @@ replace_pat(UCS *defpat, int *wrapt, int bsearch)
{
register int status;
UCS lpat[NPAT], origpat[NPAT]; /* case sensitive pattern */
- EXTRAKEYS menu_pat[2];
+ EXTRAKEYS menu_pat[10];
int repl_all = FALSE;
UCS *b;
char utf8tmp[NPMT];
UCS prompt[NPMT];
UCS *promptp;
- int flags;
+ int i, flags;
if(bsearch){
flags = SR_BACKWRD;
@@ -486,7 +486,8 @@ replace_pat(UCS *defpat, int *wrapt, int bsearch)
menu_pat[0].key = (CTRL|'X');
menu_pat[0].label = N_("Repl All");
KS_OSDATASET(&menu_pat[0], KS_NONE);
- menu_pat[1].name = NULL;
+ for (i = 1; i < 10; i++)
+ menu_pat[i].name = NULL;
while(1) {