In userland, fix printf(-like) calls without literal format and no args.
authorSascha Wildner <saw@online.de>
Mon, 6 Jan 2014 20:26:51 +0000 (21:26 +0100)
committerSascha Wildner <saw@online.de>
Mon, 6 Jan 2014 20:27:19 +0000 (21:27 +0100)
I.e., silence gcc's -Wformat-security warnings (in non-contrib code).

37 files changed:
games/factor/factor.c
games/hack/hack.eat.c
games/hack/hack.end.c
games/hack/hack.invent.c
games/hack/hack.main.c
games/hack/hack.options.c
games/hack/hack.pager.c
games/hack/hack.potion.c
games/hack/hack.rumors.c
games/hack/hack.timeout.c
games/hunt/hunt/hunt.c
lib/libc/sys/stack_protector.c
lib/libtcplay/io.c
lib/libypclnt/ypclnt_passwd.c
libexec/ftpd/ftpd.c
libexec/telnetd/utility.c
sbin/disklabel32/disklabel.c
sbin/ip6fw/ip6fw.c
sbin/ipfw/ipfw2.c
sbin/sysctl/sysctl.c
usr.bin/ee/ee.c
usr.bin/evtranalyze/evtranalyze.c
usr.bin/indent/io.c
usr.bin/ktrdump/ktrdump.c
usr.bin/mkesdb/yacc.y
usr.bin/rpcgen/rpc_hout.c
usr.bin/rpcgen/rpc_svcout.c
usr.bin/rpcgen/rpc_tblout.c
usr.bin/telnet/utilities.c
usr.sbin/atm/scspd/scsp_config_parse.y
usr.sbin/installer/dfuibe_installer/fn_configure.c
usr.sbin/installer/dfuibe_installer/fn_disk.c
usr.sbin/installer/libdfui/conn_npipe.c
usr.sbin/installer/libinstaller/commands.c
usr.sbin/mfiutil/mfi_show.c
usr.sbin/pfctl/parse.y
usr.sbin/pstat/pstat.c

index 9764008..520f65c 100644 (file)
@@ -33,7 +33,6 @@
  * @(#)factor.c        8.4 (Berkeley) 5/4/95
  * $NetBSD: factor.c,v 1.13 2002/06/18 23:07:36 simonb Exp $
  * $FreeBSD: src/games/factor/factor.c,v 1.9.2.2 2002/10/23 14:59:14 fanf Exp $
- * $DragonFly: src/games/factor/factor.c,v 1.2 2003/06/17 04:25:23 dillon Exp $
  */
 
 /*
@@ -293,7 +292,7 @@ BN_print_dec_fp(FILE *fp, const BIGNUM *num)
        buf = BN_bn2dec(num);
        if (buf == NULL)
                return; /* XXX do anything here? */
-       fprintf(fp, buf);
+       fprintf(fp, "%s", buf);
        free(buf);
 }
 
index c2b01ed..6373bc5 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* hack.eat.c - version 1.0.3 */
 /* $FreeBSD: src/games/hack/hack.eat.c,v 1.4 1999/11/16 10:26:36 marcel Exp $ */
-/* $DragonFly: src/games/hack/hack.eat.c,v 1.5 2006/08/21 19:45:32 pavalos Exp $ */
 
 #include "hack.h"
 char POISONOUS[] = "ADKSVabhks";
@@ -71,7 +70,7 @@ opentin(void)
        useup(tin.tin);
        r = rn2(2 * TTSZ);
        if (r < TTSZ) {
-               pline(tintxts[r].txt);
+               pline("%s", tintxts[r].txt);
                lesshungry(tintxts[r].nut);
                if (r == 1) {   /* SALMON */
                        Glib = rnd(15);
index c2e948a..25e5382 100644 (file)
@@ -468,7 +468,7 @@ outentry(int rank, struct toptenentry *t1, int so)
                if (t1->maxlvl != t1->level)
                        Sprintf(eos(linebuf), " [max %d]", t1->maxlvl);
                if (quit && t1->death[4])
-                       Sprintf(eos(linebuf), t1->death + 4);
+                       Sprintf(eos(linebuf), "%s", t1->death + 4);
        }
        if (dead) {
                Sprintf(eos(linebuf), " by %s%s",
@@ -484,7 +484,7 @@ outentry(int rank, struct toptenentry *t1, int so)
                char hpbuf[10];
                int hppos;
 
-               Sprintf(hpbuf, (t1->hp > 0) ? itoa(t1->hp) : "-");
+               Sprintf(hpbuf, "%s", (t1->hp > 0) ? itoa(t1->hp) : "-");
                hppos = COLNO - 7 - strlen(hpbuf);
                if (bp <= linebuf + hppos) {
                        while (bp < linebuf + hppos)
index a95efbd..bae4b75 100644 (file)
@@ -593,7 +593,7 @@ askchain(struct obj *objchn, char *olets, int allflag,
                if (ckfn && !(*ckfn)(otmp))
                        continue;
                if (!allflag) {
-                       pline(xprname(otmp, ilet));
+                       pline("%s", xprname(otmp, ilet));
                        addtopl(" [nyaq]? ");
                        sym = readchar();
                } else
@@ -637,7 +637,7 @@ obj_to_let(struct obj *obj)
 void
 prinv(struct obj *obj)
 {
-       pline(xprname(obj, obj_to_let(obj)));
+       pline("%s", xprname(obj, obj_to_let(obj)));
 }
 
 static char *
index 8718e1c..d17bdd9 100644 (file)
@@ -339,7 +339,7 @@ not_recovered:
                }
                if (multi < 0) {
                        if (!++multi) {
-                               pline(nomovemsg ? nomovemsg :
+                               pline("%s", nomovemsg ? nomovemsg :
                                      "You can move again.");
                                nomovemsg = 0;
                                if (afternmv)
index 920bdb3..63a8c2a 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* hack.options.c - version 1.0.3 */
 /* $FreeBSD: src/games/hack/hack.options.c,v 1.5 1999/11/16 02:57:08 billf Exp $ */
-/* $DragonFly: src/games/hack/hack.options.c,v 1.3 2006/08/21 19:45:32 pavalos Exp $ */
 
 #include "hack.h"
 
@@ -210,7 +209,7 @@ doset(void)
                        if (*--eop == ',')
                                *eop = 0;
                }
-               pline(buf);
+               pline("%s", buf);
        } else
                parseoptions(buf, FALSE);
 
index 121e962..b8f7080 100644 (file)
@@ -43,7 +43,7 @@ dowhatis(void)
                                                buf[0] = q;
                                                strncpy(buf + 1, "       ", 7);
                                        }
-                                       pline(buf);
+                                       pline("%s", buf);
                                        if (ep[-1] == ';') {
                                                pline("More info? ");
                                                if (readchar() == 'y') {
@@ -231,7 +231,7 @@ cornline(int mode, const char *text)
 
        /* --- now we really do it --- */
        if (mode == 2 && linect == 1)   /* topline only */
-               pline(texthead->line_text);
+               pline("%s", texthead->line_text);
        else if (mode == 2) {
                int curline, lth;
 
index aa52b28..e7879db 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* hack.potion.c - version 1.0.3 */
 /* $FreeBSD: src/games/hack/hack.potion.c,v 1.5 1999/11/16 10:26:37 marcel Exp $ */
-/* $DragonFly: src/games/hack/hack.potion.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $ */
 
 #include "hack.h"
 extern struct monst youmonst;
@@ -223,7 +222,7 @@ strange_feeling(struct obj *obj, const char *txt)
        if (flags.beginner)
                pline("You have a strange feeling for a moment, then it passes.");
        else
-               pline(txt);
+               pline("%s", txt);
        if (!objects[obj->otyp].oc_name_known && !objects[obj->otyp].oc_uname)
                docall(obj);
        useup(obj);
index fd6a45b..5453732 100644 (file)
@@ -52,7 +52,7 @@ outline(FILE *rumf)
        if ((ep = strchr(line, '\n')) != NULL)
                *ep = 0;
        pline("This cookie has a scrap of paper inside! It reads: ");
-       pline(line);
+       pline("%s", line);
 }
 
 void
index 88862f6..005e000 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* hack.timeout.c - version 1.0.3 */
 /* $FreeBSD: src/games/hack/hack.timeout.c,v 1.3 1999/11/16 02:57:12 billf Exp $ */
-/* $DragonFly: src/games/hack/hack.timeout.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $ */
 
 #include "hack.h"
 
@@ -65,7 +64,7 @@ stoned_dialogue(void)
        long i = (Stoned & TIMEOUT);
 
        if (i > 0 && i <= SIZE(stoned_texts))
-               pline(stoned_texts[SIZE(stoned_texts) - i]);
+               pline("%s", stoned_texts[SIZE(stoned_texts) - i]);
        if (i == 5)
                Fast = 0;
        if (i == 3)
index c995511..6f1858e 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: hunt.c,v 1.13 2008/03/17 09:17:56 sobrado Exp $
  * $NetBSD: hunt.c,v 1.8 1998/09/13 15:27:28 hubertf Exp $
- * $DragonFly: src/games/hunt/hunt/hunt.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 #include <ctype.h>
@@ -517,9 +516,9 @@ leave(int eval, const char *mesg)
        errno = saved_errno;
 
        if (errno == 0 && mesg != NULL)
-               errx(eval, mesg);
+               errx(eval, "%s", mesg);
        else if (mesg != NULL)
-               err(eval, mesg);
+               err(eval, "%s", mesg);
        exit(eval);
 }
 
index c90570a..2ad1c23 100644 (file)
@@ -88,7 +88,7 @@ __fail(const char *msg)
     _sigprocmask(SIG_BLOCK, &mask, NULL);
 
     /* This may fail on a chroot jail... */
-    syslog(LOG_CRIT, msg);
+    syslog(LOG_CRIT, "%s", msg);
 
     bzero(&sa, sizeof(struct sigaction));
     sigemptyset(&sa.sa_mask);
index e43c824..a19553f 100644 (file)
@@ -350,7 +350,7 @@ read_passphrase(const char *prompt, char *pass, size_t passlen, time_t timeout)
                cfd = 1;
        }
 
-       printf(prompt);
+       printf("%s", prompt);
        fflush(stdout);
 
        memset(pass, 0, passlen);
index d17a4b9..330d68d 100644 (file)
@@ -158,7 +158,7 @@ yppasswd_local(ypclnt_t *ypclnt, const struct passwd *pwd)
            (yppwd.newpw.pw_gecos = strdup(pwd->pw_gecos)) == NULL ||
            (yppwd.newpw.pw_dir = strdup(pwd->pw_dir)) == NULL ||
            (yppwd.newpw.pw_shell = strdup(pwd->pw_shell)) == NULL) {
-               ypclnt_error(ypclnt, __func__, strerror(errno));
+               ypclnt_error(ypclnt, __func__, "%s", strerror(errno));
                ret = -1;
                goto done;
        }
@@ -251,7 +251,7 @@ yppasswd_remote(ypclnt_t *ypclnt, const struct passwd *pwd, const char *passwd)
            (yppwd.newpw.pw_dir = strdup(pwd->pw_dir)) == NULL ||
            (yppwd.newpw.pw_shell = strdup(pwd->pw_shell)) == NULL ||
            (yppwd.oldpass = strdup(passwd ? passwd : "")) == NULL) {
-               ypclnt_error(ypclnt, __func__, strerror(errno));
+               ypclnt_error(ypclnt, __func__, "%s", strerror(errno));
                ret = -1;
                goto done;
        }
index 518284a..fc436fe 100644 (file)
@@ -2113,7 +2113,7 @@ send_data(FILE *instr, FILE *outstr, size_t blksize, off_t filesize, int isreg)
                                }
                        }
                        ENDXFER;
-                       reply(226, msg);
+                       reply(226, "%s", msg);
                        return (0);
                }
 
index 4956704..7e94891 100644 (file)
@@ -838,22 +838,22 @@ printsub(char direction, unsigned char *pointer, int length)
                    for (i = 2; i < length; i++ ) {
                        switch (pointer[i]) {
                        case NEW_ENV_VAR:
-                           output_data("\" VAR " + noquote);
+                           output_data("%s", "\" VAR " + noquote);
                            noquote = 2;
                            break;
 
                        case NEW_ENV_VALUE:
-                           output_data("\" VALUE " + noquote);
+                           output_data("%s", "\" VALUE " + noquote);
                            noquote = 2;
                            break;
 
                        case ENV_ESC:
-                           output_data("\" ESC " + noquote);
+                           output_data("%s", "\" ESC " + noquote);
                            noquote = 2;
                            break;
 
                        case ENV_USERVAR:
-                           output_data("\" USERVAR " + noquote);
+                           output_data("%s", "\" USERVAR " + noquote);
                            noquote = 2;
                            break;
 
index 6881985..7b29d28 100644 (file)
@@ -408,7 +408,7 @@ writelabel(int f, const char *boot, struct disklabel32 *lp)
                                warn("ioctl DIOCWLABEL");
                        msg = fixlabel(f, lp, 1);
                        if (msg) {
-                               warn(msg);
+                               warn("%s", msg);
                                return (1);
                        }
                        r = write(f, boot, lp->d_bbsize);
@@ -506,7 +506,7 @@ readlabel(int f)
                                "or pack is unlabeled)");
                }
                if ((msg = fixlabel(f, lp, 0)) != NULL)
-                       errx(1, msg);
+                       errx(1, "%s", msg);
        } else {
                lp = &lab;
                if (ioctl(f, DIOCGDINFO32, lp) < 0) {
index 0ad4d1d..b09d304 100644 (file)
@@ -286,7 +286,7 @@ show_ip6fw(struct ip6_fw *chain)
        if (mb==128 && do_resolv) {
                he=gethostbyaddr(&(chain->fw_src),sizeof(chain->fw_src),AF_INET6);
                if (he==NULL) {
-                       printf(inet_ntop(AF_INET6,&chain->fw_src,ntop_buf,sizeof(ntop_buf)));
+                       printf("%s", inet_ntop(AF_INET6,&chain->fw_src,ntop_buf,sizeof(ntop_buf)));
                } else
                        printf("%s",he->h_name);
        } else {
@@ -294,11 +294,11 @@ show_ip6fw(struct ip6_fw *chain)
                        if (mb == 0) {
                                printf("any");
                        } else {
-                               printf(inet_ntop(AF_INET6,&chain->fw_src,ntop_buf,sizeof(ntop_buf)));
+                               printf("%s", inet_ntop(AF_INET6,&chain->fw_src,ntop_buf,sizeof(ntop_buf)));
                                printf("/%d",mb);
                        }
                } else
-                       printf(inet_ntop(AF_INET6,&chain->fw_src,ntop_buf,sizeof(ntop_buf)));
+                       printf("%s", inet_ntop(AF_INET6,&chain->fw_src,ntop_buf,sizeof(ntop_buf)));
        }
 
        if (chain->fw_prot == IPPROTO_TCP || chain->fw_prot == IPPROTO_UDP) {
@@ -318,7 +318,7 @@ show_ip6fw(struct ip6_fw *chain)
        if (mb==128 && do_resolv) {
                he=gethostbyaddr(&(chain->fw_dst),sizeof(chain->fw_dst),AF_INET6);
                if (he==NULL) {
-                       printf(inet_ntop(AF_INET6,&chain->fw_dst,ntop_buf,sizeof(ntop_buf)));
+                       printf("%s", inet_ntop(AF_INET6,&chain->fw_dst,ntop_buf,sizeof(ntop_buf)));
                } else
                        printf("%s",he->h_name);
        } else {
@@ -326,11 +326,11 @@ show_ip6fw(struct ip6_fw *chain)
                        if (mb == 0) {
                                printf("any");
                        } else {
-                               printf(inet_ntop(AF_INET6,&chain->fw_dst,ntop_buf,sizeof(ntop_buf)));
+                               printf("%s", inet_ntop(AF_INET6,&chain->fw_dst,ntop_buf,sizeof(ntop_buf)));
                                printf("/%d",mb);
                        }
                } else
-                       printf(inet_ntop(AF_INET6,&chain->fw_dst,ntop_buf,sizeof(ntop_buf)));
+                       printf("%s", inet_ntop(AF_INET6,&chain->fw_dst,ntop_buf,sizeof(ntop_buf)));
        }
 
        if (chain->fw_prot == IPPROTO_TCP || chain->fw_prot == IPPROTO_UDP) {
index be1a2d6..7027fb9 100644 (file)
@@ -413,7 +413,7 @@ print_newports(ipfw_insn_u16 *cmd, int proto, int opcode)
                printf ("%s", opcode == O_MAC_TYPE ? " mac-type" :
                    (opcode == O_IP_DSTPORT ? " dst-port" : " src-port"));
        for (i = F_LEN((ipfw_insn *)cmd) - 1; i > 0; i--, p += 2) {
-               printf(sep);
+               printf("%s", sep);
                print_port(proto, p[0]);
                if (p[0] != p[1]) {
                        printf("-");
index a36d009..14f9d89 100644 (file)
@@ -448,7 +448,7 @@ S_sensor(int l2, void *p)
                                name = "unknown";
                                break;
                        }
-                       printf(name);
+                       printf("%s", name);
                        break;
                }
                case SENSOR_TIMEDELTA:
index 342b81d..ed4a24b 100644 (file)
@@ -2052,10 +2052,10 @@ get_options(int numargs, char **arguments)
                else if (!strcmp("-?", buff))
                {
                        fprintf(stderr, usage0, arguments[0]);
-                       fprintf(stderr, usage1);
-                       fprintf(stderr, usage2);
-                       fprintf(stderr, usage3);
-                       fprintf(stderr, usage4);
+                       fprintf(stderr, "%s", usage1);
+                       fprintf(stderr, "%s", usage2);
+                       fprintf(stderr, "%s", usage3);
+                       fprintf(stderr, "%s", usage4);
                        exit(1);
                }
                else if (*buff == '+')
index c0148eb..48867f1 100644 (file)
@@ -523,7 +523,7 @@ do_pass(struct pass_hook *hooks, int nhooks)
                }
        }
        if (evtr_query_error(q)) {
-               err(1, evtr_query_errmsg(q));
+               err(1, "%s", evtr_query_errmsg(q));
        }
        evtr_query_destroy(q);
 
@@ -1054,7 +1054,7 @@ cmd_show(int argc, char **argv)
                last_ts = ev.ts;
        }
        if (evtr_query_error(q)) {
-               err(1, evtr_query_errmsg(q));
+               err(1, "%s", evtr_query_errmsg(q));
        }
        evtr_query_destroy(q);
        return 0;
@@ -1412,7 +1412,7 @@ cmd_stats(int argc, char **argv)
                last_ts = ev.ts;
        }
        if (evtr_query_error(q)) {
-               err(1, evtr_query_errmsg(q));
+               err(1, "%s", evtr_query_errmsg(q));
        }
        evtr_query_destroy(q);
        statsops->report(statctx);
@@ -1453,7 +1453,7 @@ cmd_summary(int argc, char **argv)
                c->firstlast.end = ev.ts;
        }
        if (evtr_query_error(q)) {
-               err(1, evtr_query_errmsg(q));
+               err(1, "%s", evtr_query_errmsg(q));
        }
        evtr_query_destroy(q);
 
index 66a6cb1..c29c675 100644 (file)
@@ -571,12 +571,12 @@ diag2(int level, const char *msg)
        found_err = 1;
     if (output == stdout) {
        fprintf(stdout, "/**INDENT** %s@%d: ", level == 0 ? "Warning" : "Error", line_no);
-       fprintf(stdout, msg);
+       fprintf(stdout, "%s", msg);
        fprintf(stdout, " */\n");
     }
     else {
        fprintf(stderr, "%s@%d: ", level == 0 ? "Warning" : "Error", line_no);
-       fprintf(stderr, msg);
+       fprintf(stderr, "%s", msg);
        fprintf(stderr, "\n");
     }
 }
index 1186f63..bc97a23 100644 (file)
@@ -375,7 +375,7 @@ dump_devinfo(struct devinfo_dev *dev, void *arg)
        ev.fmtdatalen = sizeof(fmtdatabuf);
 
        if (evtr_dump_event(evtr, &ev)) {
-               err(1, evtr_errmsg(evtr));
+               err(1, "%s", evtr_errmsg(evtr));
        }
 
        return devinfo_foreach_device_child(dev, dump_devinfo, evtr);
@@ -407,7 +407,7 @@ dump_machine_info(evtr_t evtr)
        ev.ncpus = ncpus;
        evtr_dump_event(evtr, &ev);
        if (evtr_error(evtr)) {
-               err(1, evtr_errmsg(evtr));
+               err(1, "%s", evtr_errmsg(evtr));
        }
 
        for (i = 0; i < ncpus; ++i) {
@@ -417,7 +417,7 @@ dump_machine_info(evtr_t evtr)
                ev.cpuinfo.freq = tsc_frequency;
                evtr_dump_event(evtr, &ev);
                if (evtr_error(evtr)) {
-                       err(1, evtr_errmsg(evtr));
+                       err(1, "%s", evtr_errmsg(evtr));
                }
        }
 }
@@ -666,7 +666,7 @@ dump_callback(void *ctx, int n, int row __unused, struct ktr_entry *entry,
                ev.fmtdatalen = 0;
        }
        if (evtr_dump_event(evtr, &ev)) {
-               err(1, evtr_errmsg(evtr));
+               err(1, "%s", evtr_errmsg(evtr));
        }
        if (ev.fmtdata && conv) {
                mangle_string_ptrs(ev.fmt, __DECONST(uint8_t *, ev.fmtdata),
index 5af12dc..d56013e 100644 (file)
@@ -324,7 +324,7 @@ main(int argc, char **argv)
        case 1:
                in = fopen(argv[0], "r");
                if (!in)
-                       err(EXIT_FAILURE, argv[0]);
+                       err(EXIT_FAILURE, "%s", argv[0]);
                break;
        default:
                usage();
index 94d74e3..ba3f754 100644 (file)
@@ -28,7 +28,6 @@
  *
  * @(#)rpc_hout.c      1.16    94/04/25 SMI; 1.12 89/02/22 (C) 1987 SMI
  * $FreeBSD: src/usr.bin/rpcgen/rpc_hout.c,v 1.15 2005/11/13 21:17:24 dwmalone Exp $
- * $DragonFly: src/usr.bin/rpcgen/rpc_hout.c,v 1.5 2004/06/19 16:40:36 joerg Exp $
  */
 
 /*
@@ -480,7 +479,7 @@ pdeclaration(const char *name, declaration *dec, int tab, const char *separator)
                        break;
                }
        }
-       f_print(fout, separator);
+       f_print(fout, "%s", separator);
 }
 
 static int
index 4621634..5de6916 100644 (file)
@@ -333,7 +333,7 @@ write_real_program(definition *def)
                        f_print(fout, "(");
                        /* arg name */
                        if (proc->arg_num > 1)
-                               f_print(fout, proc->args.argname);
+                               f_print(fout, "%s", proc->args.argname);
                        else
                                ptype(proc->args.decls->decl.prefix,
                                      proc->args.decls->decl.type, 0);
index ccbb5e4..1730353 100644 (file)
@@ -28,7 +28,6 @@
  *
  * @(#)rpc_tblout.c    1.11    93/07/05 SMI; 1.4 89/02/22 (C) 1988 SMI
  * $FreeBSD: src/usr.bin/rpcgen/rpc_tblout.c,v 1.12 2005/11/13 21:17:24 dwmalone Exp $
- * $DragonFly: src/usr.bin/rpcgen/rpc_tblout.c,v 1.4 2004/06/19 16:40:36 joerg Exp $
  */
 
 /*
@@ -97,7 +96,7 @@ write_table(definition *def)
                        expected = 0;
                } else {
                        expected = 1;
-                       f_print(fout, null_entry);
+                       f_print(fout, "%s", null_entry);
                }
                for (proc = vp->procs; proc != NULL; proc = proc->next) {
                        current = atoi(proc->proc_num);
@@ -139,7 +138,7 @@ write_table(definition *def)
                }
 
                /* print the table trailer */
-               f_print(fout, tbl_end);
+               f_print(fout, "%s", tbl_end);
                f_print(fout, tbl_nproc, progvers, progvers, progvers);
        }
 }
index 938bd1f..76c82a1 100644 (file)
@@ -773,7 +773,7 @@ printsub(char direction, unsigned char *pointer, int length)
                                    fprintf(NetTrace, "\" VAR " + noquote);
                            } else
 #endif /* OLD_ENVIRON */
-                               fprintf(NetTrace, "\" VALUE " + noquote);
+                               fprintf(NetTrace, "%s", "\" VALUE " + noquote);
                            noquote = 2;
                            break;
 
@@ -789,17 +789,17 @@ printsub(char direction, unsigned char *pointer, int length)
                                    fprintf(NetTrace, "\" VALUE " + noquote);
                            } else
 #endif /* OLD_ENVIRON */
-                               fprintf(NetTrace, "\" VAR " + noquote);
+                               fprintf(NetTrace, "%s", "\" VAR " + noquote);
                            noquote = 2;
                            break;
 
                        case ENV_ESC:
-                           fprintf(NetTrace, "\" ESC " + noquote);
+                           fprintf(NetTrace, "%s", "\" ESC " + noquote);
                            noquote = 2;
                            break;
 
                        case ENV_USERVAR:
-                           fprintf(NetTrace, "\" USERVAR " + noquote);
+                           fprintf(NetTrace, "%s", "\" USERVAR " + noquote);
                            noquote = 2;
                            break;
 
index af885fe..437ecd5 100644 (file)
@@ -25,7 +25,6 @@
  * notice must be reproduced on all copies.
  *
  *     @(#) $FreeBSD: src/usr.sbin/atm/scspd/scsp_config_parse.y,v 1.3 1999/08/28 01:15:32 peter Exp $
- *     @(#) $DragonFly: src/usr.sbin/atm/scspd/scsp_config_parse.y,v 1.4 2008/11/12 21:44:59 swildner Exp $
  */
 
 
@@ -392,5 +391,5 @@ parse_error(const char *fmt, ...)
 void
 yyerror(char *s)
 {
-       parse_error(s);
+       parse_error("%s", s);
 }
index 699732c..83bfd2e 100644 (file)
@@ -210,7 +210,7 @@ fn_add_user(struct i_fn_args *a)
                            strlen(home) == 0 ? "" : "-d ", home,
                            shell,
                            strlen(groups) == 0 ? "" : "-G ", groups,
-                           (strlen(home) == 0 || !is_dir(home)) ?
+                           (strlen(home) == 0 || !is_dir("%s", home)) ?
                            "-m -k /usr/share/skel" : "");
 
                        cmd = command_add(cmds, "%s%s '%s' | "
@@ -678,7 +678,7 @@ fn_set_kbdmap(struct i_fn_args *a)
                    s);
                if (commands_execute(a, cmds)) {
                        snprintf(filename, 256, "/usr/share/syscons/keymaps/%s", s);
-                       snprintf(keymapname, 256, filename_noext(basename(filename)));
+                       snprintf(keymapname, 256, "%s", filename_noext(basename(filename)));
                        config_var_set(rc_conf, "keymap", keymapname);
                } else {
                        inform(a->c, _("Keyboard map not successfully set."));
@@ -719,7 +719,7 @@ fn_set_vidfont(struct i_fn_args *a)
 
                        snprintf(variable, 256, "font8x%d", by);
                        snprintf(filename, 256, "/usr/share/syscons/fonts/%s", s);
-                       snprintf(fontname, 256, filename_noext(basename(filename)));
+                       snprintf(fontname, 256, "%s", filename_noext(basename(filename)));
                        config_var_set(rc_conf, variable, fontname);
 
                } else {
@@ -752,7 +752,7 @@ fn_set_scrnmap(struct i_fn_args *a)
                    s);
                if (commands_execute(a, cmds)) {
                        snprintf(filename, 256, "/usr/share/syscons/scrnmaps/%s", s);
-                       snprintf(scrnmapname, 256, filename_noext(basename(filename)));
+                       snprintf(scrnmapname, 256, "%s", filename_noext(basename(filename)));
                        config_var_set(rc_conf, "scrnmap", scrnmapname);
                } else {
                        inform(a->c, _("Video font not successfully set."));
index 939d57a..11cdf97 100644 (file)
@@ -484,12 +484,12 @@ fn_install_bootblocks(struct i_fn_args *a, const char *device)
                                    strcasecmp(packet, "Y") == 0 ? "" : "no",
                                    disk);
                                command_set_failure_mode(cmd, COMMAND_FAILURE_WARN);
-                               command_set_tag(cmd, disk);
+                               command_set_tag(cmd, "%s", disk);
                                cmd = command_add(cmds, "%s%s -v %s",
                                    a->os_root, cmd_name(a, "BOOT0CFG"),
                                    disk);
                                command_set_failure_mode(cmd, COMMAND_FAILURE_WARN);
-                               command_set_tag(cmd, disk);
+                               command_set_tag(cmd, "%s", disk);
                        }
                }
 
@@ -558,7 +558,7 @@ fn_create_cdboot_floppy(struct i_fn_args *a)
 
        switch (dfui_be_present_dialog(a->c, _("Create CDBoot Floppy"),
            _("Create CDBoot Floppy|Return to Utilities Menu"),
-           msg_buf[0])) {
+           "%s", msg_buf[0])) {
        case 1:
                cmds = commands_new();
                command_add(cmds, "%s%s -c %sboot/cdboot.flp.bz2 | "
index 562b100..66960f4 100644 (file)
@@ -280,8 +280,8 @@ dfui_npipe_fe_connect(struct dfui_connection *c)
        /*
         * Wait for named pipes to be created.
         */
-       if (!is_named_pipe(T_NPIPE(c)->in_pipename)) {
-               while (!is_named_pipe(T_NPIPE(c)->in_pipename)) {
+       if (!is_named_pipe("%s", T_NPIPE(c)->in_pipename)) {
+               while (!is_named_pipe("%s", T_NPIPE(c)->in_pipename)) {
                        sleep(1);
                }
                sleep(1);
index 37aa168..0a70e1f 100644 (file)
@@ -296,7 +296,7 @@ pipe_loop(struct i_fn_args *a, struct dfui_progress *pr,
 
        asprintf(&command, "(%s) 2>&1 </dev/null", cmd->cmdline);
        fflush(stdout);
-       cmdout = aura_popen(command, "r");
+       cmdout = aura_popen("%s", command, "r");
        free(command);
 
        if (cmdout == NULL) {
index 9ecf84b..0c1b481 100644 (file)
@@ -281,7 +281,7 @@ print_pd(struct mfi_pd_info *info, int state_len)
        if (state_len > 0)
                printf("%-*s", state_len, s);
        else
-               printf(s);
+               printf("%s", s);
        s = mfi_pd_inq_string(info);
        if (s != NULL)
                printf(" %s", s);
index 5e107e7..ebc88b0 100644 (file)
@@ -4412,7 +4412,7 @@ disallow_urpf_failed(struct node_host *h, const char *fmt)
 {
        for (; h != NULL; h = h->next)
                if (h->addr.type == PF_ADDR_URPFFAILED) {
-                       yyerror(fmt);
+                       yyerror("%s", fmt);
                        return (1);
                }
        return (0);
index f405508..75500e1 100644 (file)
@@ -718,7 +718,7 @@ ttymode(void)
        int error;
        size_t len, i;
 
-       printf(hdr);
+       printf("%s", hdr);
        len = sizeof(ttyb);
        error = sysctlbyname("kern.ttys", &ttyb, &len, 0, 0);
        if (!error) {
@@ -762,7 +762,7 @@ ttytype(struct tty *tty, const char *name, int type, int number, int indir)
                KGET1(type, tty, (ssize_t)(ntty * sizeof(struct tty)),
                      "tty structs");
        }
-       printf(hdr);
+       printf("%s", hdr);
        for (tp = tty; tp < &tty[ntty]; tp++)
                ttyprt(tp, tp - tty);
 }