svn commit: r335041 - head/lib/libc/stdlib

Eitan Adler eadler at FreeBSD.org
Wed Jun 13 08:52:19 UTC 2018


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);
 }


More information about the svn-src-head mailing list