aboutsummaryrefslogtreecommitdiff
path: root/examples_library/rangebox.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples_library/rangebox.c')
-rw-r--r--examples_library/rangebox.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/examples_library/rangebox.c b/examples_library/rangebox.c
index 624bd4e438e8..06a62cc4b858 100644
--- a/examples_library/rangebox.c
+++ b/examples_library/rangebox.c
@@ -18,18 +18,24 @@ int main()
int value, output;
struct bsddialog_conf conf;
+ if (bsddialog_init() == BSDDIALOG_ERROR) {
+ printf("Error: %s\n", bsddialog_geterror());
+ return (1);
+ }
+
bsddialog_initconf(&conf);
conf.title = "rangebox";
-
- if (bsddialog_init() < 0)
- return -1;
-
value = 5;
output = bsddialog_rangebox(&conf, "Example", 8, 50, 0, 10, &value);
bsddialog_end();
- printf("Value: %d", value);
+ if (output == BSDDIALOG_ERROR) {
+ printf("Error: %s\n", bsddialog_geterror());
+ return (1);
+ }
+
+ printf("Value: %d\n", value);
- return output;
-}
+ return (output);
+} \ No newline at end of file