Module Name: src
Committed By: joerg
Date: Tue Sep 6 18:42:13 UTC 2011
Modified Files:
src/usr.bin/unzip: unzip.c
Log Message:
Use __dead and __printflike. Fix one format string and one error()
argument as hinted by the new format string checking.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/unzip/unzip.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.17 src/usr.bin/unzip/unzip.c:1.18
--- src/usr.bin/unzip/unzip.c:1.17 Thu Aug 18 11:29:27 2011
+++ src/usr.bin/unzip/unzip.c Tue Sep 6 18:42:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.17 2011/08/18 11:29:27 christos Exp $ */
+/* $NetBSD: unzip.c,v 1.18 2011/09/06 18:42:13 joerg Exp $ */
/*-
* Copyright (c) 2009, 2010 Joerg Sonnenberger <[email protected]>
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: unzip.c,v 1.17 2011/08/18 11:29:27 christos Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.18 2011/09/06 18:42:13 joerg Exp $");
#include <sys/queue.h>
#include <sys/stat.h>
@@ -98,7 +98,7 @@
static int noeol;
/* fatal error message + errno */
-static void
+__dead __printflike(1, 2) static void
error(const char *fmt, ...)
{
va_list ap;
@@ -115,7 +115,7 @@
}
/* fatal error message, no errno */
-static void
+__dead __printflike(1, 2) static void
errorx(const char *fmt, ...)
{
va_list ap;
@@ -133,7 +133,7 @@
#if 0
/* non-fatal error message + errno */
-static void
+__printflike(1, 2) static void
warning(const char *fmt, ...)
{
va_list ap;
@@ -148,9 +148,8 @@
fprintf(stderr, ": %s\n", strerror(errno));
}
#endif
-
/* non-fatal error message, no errno */
-static void
+__printflike(1, 2) static void
warningx(const char *fmt, ...)
{
va_list ap;
@@ -166,7 +165,7 @@
}
/* informational message (if not -q) */
-static void
+__printflike(1, 2) static void
info(const char *fmt, ...)
{
va_list ap;
@@ -185,7 +184,7 @@
}
/* debug message (if unzip_debug) */
-static void
+__printflike(1, 2) static void
debug(const char *fmt, ...)
{
va_list ap;
@@ -580,7 +579,7 @@
/* simple case */
if (!a_opt || !text) {
if (write(fd, buffer, len) != len)
- error("write('%s')", path);
+ error("write('%s')", *path);
continue;
}
@@ -946,7 +945,7 @@
if (t_opt) {
if (error_count > 0) {
- errorx("%d checksum error(s) found.", error_count);
+ errorx("%jd checksum error(s) found.", error_count);
}
else {
printf("No errors detected in compressed data of %s.\n",