summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-01-10 13:57:46 +0000
committerjkh <jkh@FreeBSD.org>1996-01-10 13:57:46 +0000
commitcb56a0376feda30d3870a4c2d48a92e1c930b5d4 (patch)
tree831db552e0a40ac7055dba261b0ece132f09798b
parent66264c864cebdef04968959ffb4d184594b8c7ef (diff)
downloadFreeBSD-src-cb56a0376feda30d3870a4c2d48a92e1c930b5d4.zip
FreeBSD-src-cb56a0376feda30d3870a4c2d48a92e1c930b5d4.tar.gz
Fix small bug with negative item_no.
-rw-r--r--gnu/lib/libdialog/radiolist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c
index 97ada1c..8ae84c2 100644
--- a/gnu/lib/libdialog/radiolist.c
+++ b/gnu/lib/libdialog/radiolist.c
@@ -49,7 +49,7 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
dialogMenuItem *ditems;
/* Allocate space for storing item on/off status */
- if ((status = alloca(sizeof(int)*item_no)) == NULL) {
+ if ((status = alloca(sizeof(int) * abs(item_no))) == NULL) {
endwin();
fprintf(stderr, "\nCan't allocate memory in dialog_radiolist().\n");
exit(-1);
OpenPOWER on IntegriCloud