From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 06:51:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03926106566B; Fri, 13 Jan 2012 06:51:16 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5598FC14; Fri, 13 Jan 2012 06:51:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0D6pFwU046748; Fri, 13 Jan 2012 06:51:15 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D6pF0l046741; Fri, 13 Jan 2012 06:51:15 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201130651.q0D6pF0l046741@svn.freebsd.org> From: Kevin Lo Date: Fri, 13 Jan 2012 06:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230044 - in head: usr.bin/mail usr.bin/tftp usr.bin/unzip usr.sbin/config usr.sbin/lpr/lpc usr.sbin/timed/timedc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 06:51:16 -0000 Author: kevlo Date: Fri Jan 13 06:51:15 2012 New Revision: 230044 URL: http://svn.freebsd.org/changeset/base/230044 Log: fgets(3) returns a pointer, so compare against NULL, not integer 0. Modified: head/usr.bin/mail/edit.c head/usr.bin/tftp/main.c head/usr.bin/unzip/unzip.c head/usr.sbin/config/mkmakefile.c head/usr.sbin/lpr/lpc/lpc.c head/usr.sbin/timed/timedc/timedc.c Modified: head/usr.bin/mail/edit.c ============================================================================== --- head/usr.bin/mail/edit.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.bin/mail/edit.c Fri Jan 13 06:51:15 2012 (r230044) @@ -89,7 +89,7 @@ edit1(int *msgvec, int type) char *p; printf("Edit message %d [ynq]? ", msgvec[i]); - if (fgets(buf, sizeof(buf), stdin) == 0) + if (fgets(buf, sizeof(buf), stdin) == NULL) break; for (p = buf; *p == ' ' || *p == '\t'; p++) ; Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.bin/tftp/main.c Fri Jan 13 06:51:15 2012 (r230044) @@ -734,7 +734,7 @@ command(void) history(hist, &he, H_ENTER, bp); } else { line[0] = 0; - if (fgets(line, sizeof line , stdin) == 0) { + if (fgets(line, sizeof line , stdin) == NULL) { if (feof(stdin)) { exit(txrx_error); } else { Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.bin/unzip/unzip.c Fri Jan 13 06:51:15 2012 (r230044) @@ -422,7 +422,7 @@ handle_existing_file(char **path) fprintf(stderr, "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", *path); - if (fgets(buf, sizeof(buf), stdin) == 0) { + if (fgets(buf, sizeof(buf), stdin) == NULL) { clearerr(stdin); printf("NULL\n(EOF or read error, " "treating as \"[N]one\"...)\n"); Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.sbin/config/mkmakefile.c Fri Jan 13 06:51:15 2012 (r230044) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1993, 19801990 + * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -154,7 +154,7 @@ makefile(void) fprintf(ofp, "PROFLEVEL=%d\n", profiling); if (*srcdir != '\0') fprintf(ofp,"S=%s\n", srcdir); - while (fgets(line, BUFSIZ, ifp) != 0) { + while (fgets(line, BUFSIZ, ifp) != NULL) { if (*line != '%') { fprintf(ofp, "%s", line); continue; @@ -204,7 +204,7 @@ makehints(void) ifp = fopen(hint->hint_name, "r"); if (ifp == NULL) err(1, "%s", hint->hint_name); - while (fgets(line, BUFSIZ, ifp) != 0) { + while (fgets(line, BUFSIZ, ifp) != NULL) { /* zap trailing CR and/or LF */ while ((s = strrchr(line, '\n')) != NULL) *s = '\0'; @@ -266,7 +266,7 @@ makeenv(void) fprintf(ofp, "int envmode = %d;\n", envmode); fprintf(ofp, "char static_env[] = {\n"); if (ifp) { - while (fgets(line, BUFSIZ, ifp) != 0) { + while (fgets(line, BUFSIZ, ifp) != NULL) { /* zap trailing CR and/or LF */ while ((s = strrchr(line, '\n')) != NULL) *s = '\0'; Modified: head/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.sbin/lpr/lpc/lpc.c Fri Jan 13 06:51:15 2012 (r230044) @@ -188,7 +188,7 @@ cmdscanner(void) history(hist, &he, H_ENTER, bp); } else { - if (fgets(cmdline, MAX_CMDLINE, stdin) == 0) + if (fgets(cmdline, MAX_CMDLINE, stdin) == NULL) quit(0, NULL); if (cmdline[0] == 0 || cmdline[0] == '\n') break; Modified: head/usr.sbin/timed/timedc/timedc.c ============================================================================== --- head/usr.sbin/timed/timedc/timedc.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.sbin/timed/timedc/timedc.c Fri Jan 13 06:51:15 2012 (r230044) @@ -105,7 +105,7 @@ main(argc, argv) printf("timedc> "); (void) fflush(stdout); } - if (fgets(cmdline, sizeof(cmdline), stdin) == 0) + if (fgets(cmdline, sizeof(cmdline), stdin) == NULL) quit(); if (cmdline[0] == 0) break;