From c76941f24fce3de5023b205076d67757d6b045e9 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 8 Jun 2008 23:45:07 +0200 Subject: [PATCH] Fix GCC 3.4.4 warnings about ambigous else, in "else if" construct by relying on the original indentation. Change exit(0) to return 0; to kill off warning about "non-void funtion". --- examples/testit.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/testit.c b/examples/testit.c index 6a47e3f..122c789 100755 --- a/examples/testit.c +++ b/examples/testit.c @@ -49,18 +49,21 @@ main(ac, av) while ((p = readline(prompt)) != NULL) { (void)printf("\t\t\t|%s|\n", p); - if (doit) + if (doit) { if (strncmp(p, "cd ", 3) == 0) { - if (chdir(&p[3]) < 0) + if (chdir(&p[3]) < 0) { perror(&p[3]); + } } - else if (system(p) != 0) + else if (system(p) != 0) { perror(p); + } + } add_history(p); free(p); } - exit(0); - /* NOTREACHED */ + + return 0; } /*