Date: Mon, 18 Apr 2016 07:40:36 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298193 - head/sbin/bsdlabel Message-ID: <201604180740.u3I7eaDO061596@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Mon Apr 18 07:40:36 2016 New Revision: 298193 URL: https://svnweb.freebsd.org/changeset/base/298193 Log: Use NULL instead of 0 for pointers. strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks. Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Mon Apr 18 07:36:24 2016 (r298192) +++ head/sbin/bsdlabel/bsdlabel.c Mon Apr 18 07:40:36 2016 (r298193) @@ -781,7 +781,7 @@ getasciilabel(FILE *f, struct disklabel lp->d_sbsize = 0; /* XXX */ while (fgets(line, sizeof(line) - 1, f)) { lineno++; - if ((cp = strchr(line,'\n')) != 0) + if ((cp = strchr(line,'\n')) != NULL) *cp = '\0'; cp = skip(line); if (cp == NULL)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604180740.u3I7eaDO061596>