diff options
author | corvid <corvid@lavabit.com> | 2011-05-29 20:14:42 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-05-29 20:14:42 +0000 |
commit | 337e93ffdc71a9a93090282c2152c21229db0995 (patch) | |
tree | 5a775691cb27320c8d3912ca7ca503f78f18cceb /src | |
parent | e6e3d87c3d402bdc323ccccc22f2a12a5609530e (diff) |
choice5: don't crash in the absence of choices
Diffstat (limited to 'src')
-rw-r--r-- | src/dialog.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dialog.cc b/src/dialog.cc index 7f2b31c0..51f44562 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -176,6 +176,11 @@ int a_Dialog_choice5(const char *QuestionTxt, txt[4] = alt4; txt[5] = alt5; for (int i=1; txt[i]; ++i, ++nb) ; + + if (!nb) { + MSG_ERR("a_Dialog_choice5: No choices.\n"); + return choice5_answer; + } ww = 140 + nb*(bw+10); Fl_Window *window = new Fl_Window(ww,wh,"Choice5"); |