svn commit: r298599 - head/usr.bin/stat

Marcelo Araujo araujo at FreeBSD.org
Tue Apr 26 00:29:02 UTC 2016


Author: araujo
Date: Tue Apr 26 00:29:00 2016
New Revision: 298599
URL: https://svnweb.freebsd.org/changeset/base/298599

Log:
  Use MIN() instead of MAX() as the previous syntax was wrote in a weird and
  confused way: "prec > 9 ? 9 : prec".
  
  Submitted by:	pfg, ngie and luke <luke.tw at gmail.com>
  MFC after:	2 weeks.

Modified:
  head/usr.bin/stat/stat.c

Modified: head/usr.bin/stat/stat.c
==============================================================================
--- head/usr.bin/stat/stat.c	Mon Apr 25 23:12:39 2016	(r298598)
+++ head/usr.bin/stat/stat.c	Tue Apr 26 00:29:00 2016	(r298599)
@@ -1025,7 +1025,7 @@ format1(const struct stat *st,
 		 *
 		 * Nanoseconds: long.
 		 */
-		(void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec));
+		(void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));
 		(void)strcat(lfmt, tmp);
 
 		/*


More information about the svn-src-head mailing list