]> granicus.if.org Git - shadow/commitdiff
* libmisc/loginprompt.c: Use exit(EXIT_FAILURE) instead of
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 17:34:46 +0000 (17:34 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 17:34:46 +0000 (17:34 +0000)
exit(1).
* libmisc/loginprompt.c: Avoid implicit conversion of pointers to
booleans.
* libmisc/loginprompt.c: Ignore return value of putc().

ChangeLog
libmisc/loginprompt.c

index 439acc12e22dba0bb13df1dca8e1e1935d654a8e..6caf58f7b2a01f00032ef21a5f10a0249a36f29b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-22  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/loginprompt.c: Use exit(EXIT_FAILURE) instead of
+       exit(1).
+       * libmisc/loginprompt.c: Avoid implicit conversion of pointers to
+       booleans.
+       * libmisc/loginprompt.c: Ignore return value of putc().
+
 2009-04-22  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/env.c, libmisc/age.c: Added splint annotations.
index 778475d1a3e90b5bb8f1aaad8d44fc7ca46eddab..1d968d760400dfc8abd431cc969c0573762d904e 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1989 - 1993, Julianne Frances Haugh
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2003 - 2005, Tomasz Kłoczko
- * Copyright (c) 2008       , Nicolas François
+ * Copyright (c) 2008 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 static void login_exit (unused int sig)
 {
-       exit (1);
+       exit (EXIT_FAILURE);
 }
 
 /*
@@ -86,13 +86,13 @@ void login_prompt (const char *prompt, char *name, int namesize)
         * be displayed and display it before the prompt.
         */
 
-       if (prompt) {
+       if (NULL != prompt) {
                cp = getdef_str ("ISSUE_FILE");
                if (NULL != cp) {
                        fp = fopen (cp, "r");
                        if (NULL != fp) {
                                while ((i = getc (fp)) != EOF) {
-                                       putc (i, stdout);
+                                       (void) putc (i, stdout);
                                }
 
                                (void) fclose (fp);
@@ -110,12 +110,12 @@ void login_prompt (const char *prompt, char *name, int namesize)
 
        memzero (buf, sizeof buf);
        if (fgets (buf, (int) sizeof buf, stdin) != buf) {
-               exit (1);
+               exit (EXIT_FAILURE);
        }
 
        cp = strchr (buf, '\n');
        if (NULL == cp) {
-               exit (1);
+               exit (EXIT_FAILURE);
        }
        *cp = '\0';             /* remove \n [ must be there ] */