diff options
Diffstat (limited to 'examples_library/datebox.c')
| -rw-r--r-- | examples_library/datebox.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/examples_library/datebox.c b/examples_library/datebox.c index 7f0138688d53..e0741319d388 100644 --- a/examples_library/datebox.c +++ b/examples_library/datebox.c @@ -10,7 +10,6 @@ #include <bsddialog.h> #include <stdio.h> -#include <string.h> #include <time.h> int main() @@ -31,25 +30,15 @@ int main() printf("Error: %s\n", bsddialog_geterror()); return (1); } - bsddialog_initconf(&conf); conf.title = "datebox"; output = bsddialog_datebox(&conf, "Example", 9, 35, &yy, &mm, &dd); - bsddialog_end(); - - switch (output) { - case BSDDIALOG_OK: - printf("Date: %u/%u/%u", yy, mm, dd); - break; - case BSDDIALOG_CANCEL: - printf("Cancel"); - break; - case BSDDIALOG_ERROR: - printf("Error: %s", bsddialog_geterror()); - break; + if (output == BSDDIALOG_ERROR) { + printf("Error: %s\n", bsddialog_geterror()); + return (1); } - printf("\n"); + printf("Date: %u/%u/%u\n", yy, mm, dd); - return (output); + return (0); }
\ No newline at end of file |
