Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jun 2010 23:14:07 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 179665 for review
Message-ID:  <201006152314.o5FNE7nY093615@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@179665?ac=10

Change 179665 by gabor@gabor_aspire on 2010/06/15 23:14:02

	- Fix some warnings
	
	Found by: clang

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/grep/file.c#50 edit
.. //depot/projects/soc2008/gabor_textproc/grep/grep.c#94 edit

Differences ...

==== //depot/projects/soc2008/gabor_textproc/grep/file.c#50 (text+ko) ====

@@ -81,7 +81,7 @@
 		if (bzerr == BZ_STREAM_END)
 			return (-1);
 		else if (bzerr != BZ_SEQUENCE_ERROR && bzerr != BZ_OK)
-			errx(2, getstr(2));
+			errx(2, "%s", getstr(2));
 		return (c);
 	}
 	return (-1);
@@ -180,7 +180,7 @@
 {
 	struct file *f;
 
-	snprintf(fname, sizeof fname, getstr(1));
+	snprintf(fname, sizeof fname, "%s", getstr(1));
 
 	f = grep_malloc(sizeof *f);
 

==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#94 (text+ko) ====

@@ -149,10 +149,10 @@
 usage(void)
 {
 	fprintf(stderr, getstr(4), __progname);
-	fprintf(stderr, getstr(5));
-	fprintf(stderr, getstr(5));
-	fprintf(stderr, getstr(6));
-	fprintf(stderr, getstr(7));
+	fprintf(stderr, "%s", getstr(5));
+	fprintf(stderr, "%s", getstr(5));
+	fprintf(stderr, "%s", getstr(6));
+	fprintf(stderr, "%s", getstr(7));
 	exit(2);
 }
 
@@ -530,7 +530,7 @@
 			else if (strcmp("text", optarg) == 0)
 				binbehave = BINFILE_TEXT;
 			else
-				errx(2, getstr(8));
+				errx(2, "%s", getstr(8));
 			break;
 		case COLOR_OPT:
 			if (optarg == NULL || strcmp("auto", optarg) == 0 || strcmp("always", optarg) == 0 ) {
@@ -542,7 +542,7 @@
 			} else if (strcmp("never", optarg) == 0)
 				color = NULL;
 			else
-				errx(2, getstr(3));
+				errx(2, "%s", getstr(3));
 			break;
 		case LABEL_OPT:
 			label = optarg;



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