Commit c9d2ed80 authored by rswindell's avatar rswindell
Browse files

ulist() option list can be terminated by a NULL pointer.

parent e7669a1c
......@@ -374,7 +374,7 @@ if(mode&WIN_GET) bline|=BL_GET;
if(mode&WIN_PUT) bline|=BL_PUT;
bottomline(bline);
while(opts<max_opts && opts<MAX_OPTS)
if(option[opts][0]==0)
if(option[opts]==NULL || option[opts][0]==0)
break;
else opts++;
if(mode&WIN_XTR && opts<max_opts && opts<MAX_OPTS)
......
......@@ -636,7 +636,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if(mode&WIN_PUT) bline|=BL_PUT;
bottomline(bline);
while(opts<MAX_OPTS)
if(option[opts][0]==0)
if(option[opts]==NULL || option[opts][0]==0)
break;
else opts++;
if(mode&WIN_XTR && opts<MAX_OPTS)
......
......@@ -422,7 +422,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if(mode&WIN_PUT) bline|=BL_PUT;
bottomline(bline);
while(opts<max_opts && opts<MAX_OPTS)
if(option[opts][0]==0)
if(option[opts]==NULL || option[opts][0]==0)
break;
else opts++;
if(mode&WIN_XTR && opts<max_opts && opts<MAX_OPTS)
......
......@@ -135,7 +135,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
/* Count number of menu options */
for(cnt=0;cnt<MAX_OPTS;cnt++)
if(option[cnt][0]==0)
if(option[cnt]==NULL || option[cnt][0]==0)
break;
options=cnt;
freecnt=cnt+5; /* Add, Delete, Copy, Paste, At End */
......
......@@ -200,7 +200,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
int lines;
for(opts=0;opts<MAX_OPTS;opts++)
if(option[opts][0]==0)
if(option[opts]==NULL || option[opts][0]==0)
break;
if((*cur)>=opts)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment