Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/unzip Use __dead and __printflike. Fix one format st...



details:   https://anonhg.NetBSD.org/src/rev/7b073cfec56e
branches:  trunk
changeset: 769341:7b073cfec56e
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Sep 06 18:42:13 2011 +0000

description:
Use __dead and __printflike. Fix one format string and one error()
argument as hinted by the new format string checking.

diffstat:

 usr.bin/unzip/unzip.c |  21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diffs (92 lines):

diff -r 7ae23b688ccc -r 7b073cfec56e usr.bin/unzip/unzip.c
--- a/usr.bin/unzip/unzip.c     Tue Sep 06 18:35:41 2011 +0000
+++ b/usr.bin/unzip/unzip.c     Tue Sep 06 18:42:13 2011 +0000
@@ -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 <joerg%NetBSD.org@localhost>
@@ -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",



Home | Main Index | Thread Index | Old Index