[Midnightbsd-cvs] src [7592] trunk/usr.bin/msearch: fix zeroflag code to work with clang

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat May 28 15:02:11 EDT 2016


Revision: 7592
          http://svnweb.midnightbsd.org/src/?rev=7592
Author:   laffer1
Date:     2016-05-28 15:02:11 -0400 (Sat, 28 May 2016)
Log Message:
-----------
fix zeroflag code to work with clang

Modified Paths:
--------------
    trunk/usr.bin/msearch/Makefile
    trunk/usr.bin/msearch/msearch.c

Modified: trunk/usr.bin/msearch/Makefile
===================================================================
--- trunk/usr.bin/msearch/Makefile	2016-05-28 18:45:58 UTC (rev 7591)
+++ trunk/usr.bin/msearch/Makefile	2016-05-28 19:02:11 UTC (rev 7592)
@@ -1,10 +1,9 @@
-# $MidnightBSD: src/usr.bin/msearch/Makefile,v 1.6 2011/08/07 06:25:00 laffer1 Exp $
+# $MidnightBSD$
 
 PROG=	msearch
 
 CFLAGS+= -I${.CURDIR}/../../lib/libsearch
 
-WARNS?=	1
 CSTD=	c99
 
 DPADD=  ${LIBMSEARCH} ${LIBZ} ${LIBSQLITE3}

Modified: trunk/usr.bin/msearch/msearch.c
===================================================================
--- trunk/usr.bin/msearch/msearch.c	2016-05-28 18:45:58 UTC (rev 7591)
+++ trunk/usr.bin/msearch/msearch.c	2016-05-28 19:02:11 UTC (rev 7592)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD: src/usr.bin/msearch/msearch.c,v 1.6 2011/08/06 23:02:26 laffer1 Exp $");
+__MBSDID("$MidnightBSD$");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -101,15 +101,17 @@
 		while (current != NULL) {
 			if (current->path != NULL) {
 				if (tflag && rflag) {
+					printf("%0.2f %s", current->weight, current->path);
 					if (zeroflag)
-						printf("%0.2f %s\0", current->weight, current->path);
+						fputc('\0', stdout);
 					else
-						printf("%0.2f %s\n", current->weight, current->path);
+						fputc('\n', stdout);
 				} else {
+					printf("%s", current->path);
 					if (zeroflag)
-						printf("%s\0", current->path);
+						fputc('\0', stdout);
 					else
-						printf("%s\n", current->path);
+						fputc('\n', stdout);
 				}
 			}
 			current = current->next;



More information about the Midnightbsd-cvs mailing list