progs: Fix a number of format-related errors.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 22 Jun 2013 14:03:33 +0000 (15:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 28 Jun 2013 23:30:17 +0000 (00:30 +0100)
Picked up by the new `mLib' attribute machinery.

progs/catcrypt.c
progs/catsign.c
progs/cc-enc.c
progs/key.c

index 6e0db1d..f4d10c9 100644 (file)
@@ -206,7 +206,7 @@ static int encrypt(int argc, char *argv[])
     ofp = stdout;
   else if ((ofp = fopen(of, eo->wmode)) == 0) {
     die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
-       ofp, strerror(errno));
+       of, strerror(errno));
   }
 
   dstr_reset(&d);
@@ -506,7 +506,7 @@ static int decrypt(int argc, char *argv[])
     if ((ofp = fopen(of, "wb")) == 0) {
       if (f & f_progress) fprogress_done(&ff);
       die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
-         ofp, strerror(errno));
+         of, strerror(errno));
     }
     rfp = ofp;
   } else if ((rfp = tmpfile()) == 0) {
index 48f8fcb..47a951e 100644 (file)
@@ -437,7 +437,7 @@ static void sig_writesig(enc *e, sigmsg *s)
   { chunk_write(e, s->sig.buf, s->sig.len); }
 
 static void diechoke(const char *m, void *p)
-  { die(EXIT_FAILURE, "%s%s%s", p, p ? ": " : "", m); }
+  { die(EXIT_FAILURE, "%s%s%s", (const char *)p, p ? ": " : "", m); }
 
 static void sig_readheader(enc *e, sigmsg *s,
                           void (*choke)(const char *, void *), void *p)
@@ -536,7 +536,7 @@ static int sign(int argc, char *argv[])
     ofp = stdout;
   else if ((ofp = fopen(of, eo->wmode)) == 0) {
     die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
-       ofp, strerror(errno));
+       of, strerror(errno));
   }
 
   /* --- Start the work --- */
index 61d9805..f4b6119 100644 (file)
@@ -410,7 +410,7 @@ int cmd_encode(int argc, char *argv[])
     ofp = stdout;
   else if ((ofp = fopen(of, eo->wmode)) == 0) {
     die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
-       ofp, strerror(errno));
+       of, strerror(errno));
   }
 
   e = initenc(eo, ofp, bd);
@@ -492,7 +492,7 @@ int cmd_decode(int argc, char *argv[])
     ofp = stdout;
   else if ((ofp = fopen(of, "wb")) == 0) {
     die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
-       ofp, strerror(errno));
+       of, strerror(errno));
   }
 
   e = initdec(eo, fp, checkbdry, (/*unconst*/ void *)bd);
index f263aaf..fe5f313 100644 (file)
@@ -290,7 +290,7 @@ static mp *getmp(key_data *k, const char *tag)
   if (!k)
     die(EXIT_FAILURE, "unexpected failure looking up subkey `%s'", tag);
   if ((k->e & KF_ENCMASK) != KENC_MP)
-    die(EXIT_FAILURE, "subkey `%s' has an incompatible type");
+    die(EXIT_FAILURE, "subkey `%s' has an incompatible type", tag);
   return (k->u.m);
 }