minor coding style/properness changes
(checking return value, using EXIT_SUCCESS variables, etc)

--- a/news.c
+++ b/news.c
@@ -17,31 +17,34 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifndef lint
 static char rcsid[] = "$Id: news.c,v 1.12 1997/01/10 17:09:19 int Exp $";
+#endif
 
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <ctype.h>
 #include <string.h>
-#include <dirent.h>
+#include <termios.h>
+#include <unistd.h>
+#include <utime.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/time.h>
-#include <utime.h>
-#include <fcntl.h>
-#include <pwd.h>
-#include <termios.h>
-#include <errno.h>
-#include <limits.h>
+#include <time.h>
 #include "getopt.h"
 #include "news.h"
 
 
 char  *progname;
-char  *newsdir = NEWSDIR;
-char  *dformat = DATEFORMAT;
+const char  *newsdir = NEWSDIR;
+const char  *dformat = DATEFORMAT;
 char  **exclude_list = 0;
 int   nr_exclude = 0;
 
@@ -67,7 +70,7 @@
 /*
  * MAIN
  */
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
   int	ac = 0, n, i;
   char *av[32], **nav, *env;
@@ -95,7 +98,7 @@
      else
       read_sysnews(argc, argv);
 
-  exit(0);
+  exit(EXIT_SUCCESS);
 }
 
 
@@ -168,13 +171,13 @@
 		   break;
 	      case 'V':
 		   printf("news version %s\n", VERSION);
-		   exit(0);
+		   exit(EXIT_SUCCESS);
 	      case 'h':            /* hm. what could this be? */
 		   print_usage();
-		   exit(0);
+		   exit(EXIT_SUCCESS);
 	      default:
 		   fprintf(stderr, "Type `%s --help' for more information.\n", progname);
-		   exit(1);
+		   exit(EXIT_FAILURE);
 		   break;
 	}
 
@@ -192,14 +195,17 @@
   char	 tmp[512];
   char	 *newsnames;
   int	 art_cnt = 0, avc;
-  int	 cols = 80;
+  unsigned short	 cols = 80;
   int	 ret;
 
+     /* Clearout temporary data space. */
+     (void) memset(tmp, 0, 512);
+
      home = getenv("HOME");
      if(!home)
        {
 	  fprintf(stderr, "%s: error: you are homeless!\n", progname);
-	  exit(1);
+	  exit(EXIT_FAILURE);
        }
      sprintf(line, "%s/%s", home, NEWSTIME);
 
@@ -207,7 +213,7 @@
      if(ret < 0)
        {
 	 if(errno != ENOENT)
-	   exit(1);
+	   exit(EXIT_FAILURE);
 	 if(!f.all && !f.items && !f.names && !argv[optind])
 	   {
 	     ret = creat(line, 0600);
@@ -226,8 +232,14 @@
 	     cols = win.ws_col;
       }
 #endif
-     newsnames = malloc(cols);
-     newsnames[0] = 0;
+     errno = 0;
+     newsnames = malloc((size_t)cols);
+     if (newsnames == NULL)
+      {
+        perror("news: ");
+        exit(EXIT_FAILURE);
+      }
+     memset(newsnames, 0, cols);
 
 
     if(!f.all && !f.items && !f.names && !argv[optind])
@@ -243,7 +255,7 @@
      if(!dfp)
        {
 	 fprintf(stderr, "%s: opendir(%s): %s\n", progname, newsdir, ERRMSG);
-	 exit(1);
+	 exit(EXIT_FAILURE);
        }
 
 
@@ -281,7 +293,7 @@
 		  {
 		    pfp = open_pager();
 		    if(!pfp)
-		      exit(1);
+		      exit(EXIT_FAILURE);
 		  }
 
 		pw = getpwuid(st.st_uid);
@@ -379,7 +391,7 @@
 FILE *open_pager()
 {
   FILE *pfp;
-  char *pager;
+  const char *pager;
 
      if(!(pager = f.pager) && !(pager = getenv("PAGER")))
       pager = DEF_PAGER;
@@ -426,7 +438,7 @@
      if(!dfp)
        {
 	 fprintf(stderr, "Error opening newsdir (%s): %s\n", newsdir, ERRMSG);
-	 exit(1);
+	 exit(EXIT_FAILURE);
        }
 
      chdir(newsdir);
@@ -447,9 +459,12 @@
 
 	 for(i = 0; i < nr_exclude; i++)
 	   if(!strcmp(exclude_list[i], dir->d_name))
-	     continue;
+	     break;
+	 if(i<nr_exclude)
+	   continue;
 
-	 stat(dir->d_name, &st);
+	 if(stat(dir->d_name, &st))
+	   continue;
 	 if(st.st_mtime < exp_t)
 	  {
 	    ret = unlink(dir->d_name);
@@ -507,11 +522,16 @@
 			lineidx = 0;
 			st = 0;
 
+			errno = 0;
 			if(!nr_exclude)
 			  exclude_list = (char **)malloc(sizeof(char *));
 			else
 			  exclude_list = (char **)realloc(exclude_list,
 					       sizeof(char *) * (nr_exclude + 1));
+			if (exclude_list == NULL) {
+				perror("news: ");
+				exit(EXIT_FAILURE);
+			}
 			exclude_list[nr_exclude++] = strdup(line);
 		      }
 		    if(!*str)
@@ -523,7 +543,7 @@
 		   if(lineidx >= NAME_MAX)
 		     {
 		       fprintf(stderr, "add_exclude: filename too long (%d)\n", lineidx);
-		       exit(1);
+		       exit(EXIT_FAILURE);
 		     }
 		   break;
 	    }
--- a/news.h
+++ b/news.h
@@ -32,13 +32,13 @@
 
 
 struct {
-  int    all:1;
-  int    items:1;
-  int    names:1;
-  int	 page:1;
-  int    oneperline:1;
-  int    datestamp:1;
-  int    verbose:1;
+  int    all;
+  int    items;
+  int    names;
+  int	 page;
+  int    oneperline;
+  int    datestamp;
+  int    verbose;
   int	 expire;
   char	 *pager;
   } f;
@@ -53,7 +53,7 @@
 
 
 /* news.c */
-void main __PROTO((int argc , char **argv ));
+int main __PROTO((int argc , char **argv ));
 int implode __PROTO((char *str , char *av [], int max ));
 void parse_args __PROTO((int argc , char **argv ));
 void read_sysnews __PROTO((int argc , char **argv ));
