+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.
* 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
static void login_exit (unused int sig)
{
- exit (1);
+ exit (EXIT_FAILURE);
}
/*
* 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);
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 ] */