Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 08:52:17 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335041 - head/lib/libc/stdlib
Message-ID:  <201806130852.w5D8qH9a093758@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Wed Jun 13 08:52:17 2018
New Revision: 335041
URL: https://svnweb.freebsd.org/changeset/base/335041

Log:
  libc: remove explicit cast NULL in atoi
  
  There isn't any reason to cast NULL so just remove it. Noticed when
  cleaning up top.
  
  Reviewed by:	pstef

Modified:
  head/lib/libc/stdlib/atoi.3
  head/lib/libc/stdlib/atoi.c

Modified: head/lib/libc/stdlib/atoi.3
==============================================================================
--- head/lib/libc/stdlib/atoi.3	Wed Jun 13 08:52:14 2018	(r335040)
+++ head/lib/libc/stdlib/atoi.3	Wed Jun 13 08:52:17 2018	(r335041)
@@ -57,7 +57,7 @@ representation.
 .Pp
 It is equivalent to:
 .Bd -literal -offset indent
-(int)strtol(nptr, (char **)NULL, 10);
+(int)strtol(nptr, NULL, 10);
 .Ed
 .Pp
 The

Modified: head/lib/libc/stdlib/atoi.c
==============================================================================
--- head/lib/libc/stdlib/atoi.c	Wed Jun 13 08:52:14 2018	(r335040)
+++ head/lib/libc/stdlib/atoi.c	Wed Jun 13 08:52:17 2018	(r335041)
@@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$");
 int
 atoi(const char *str)
 {
-	return (int)strtol(str, (char **)NULL, 10);
+	return (int)strtol(str, NULL, 10);
 }
 
 int
 atoi_l(const char *str, locale_t locale)
 {
-	return (int)strtol_l(str, (char **)NULL, 10, locale);
+	return (int)strtol_l(str, NULL, 10, locale);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806130852.w5D8qH9a093758>