summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-07-05 09:51:09 +0000
committerkris <kris@FreeBSD.org>2001-07-05 09:51:09 +0000
commit307edbea2bb0f1ffb76cf867d713bb6f1bb74b9b (patch)
tree6006e77cf1cf9d98520733e49acc09ef5b89a69f
parentfc3cfdc00e12f88128da41ed99b65020b8c361c8 (diff)
downloadFreeBSD-src-307edbea2bb0f1ffb76cf867d713bb6f1bb74b9b.zip
FreeBSD-src-307edbea2bb0f1ffb76cf867d713bb6f1bb74b9b.tar.gz
Mark relevant functions __printflike()/__printf0like() and silence some of
the non-constant format string warnings. MFC after: 1 week
-rw-r--r--usr.sbin/sade/command.c2
-rw-r--r--usr.sbin/sade/dispatch.c2
-rw-r--r--usr.sbin/sade/msg.c4
-rw-r--r--usr.sbin/sade/sade.h28
-rw-r--r--usr.sbin/sade/variable.c2
-rw-r--r--usr.sbin/sade/wizard.c2
-rw-r--r--usr.sbin/sysinstall/anonFTP.c2
-rw-r--r--usr.sbin/sysinstall/command.c2
-rw-r--r--usr.sbin/sysinstall/dispatch.c2
-rw-r--r--usr.sbin/sysinstall/index.c2
-rw-r--r--usr.sbin/sysinstall/msg.c4
-rw-r--r--usr.sbin/sysinstall/network.c2
-rw-r--r--usr.sbin/sysinstall/pccard.c2
-rw-r--r--usr.sbin/sysinstall/sysinstall.h28
-rw-r--r--usr.sbin/sysinstall/tcpip.c2
-rw-r--r--usr.sbin/sysinstall/user.c4
-rw-r--r--usr.sbin/sysinstall/variable.c2
-rw-r--r--usr.sbin/sysinstall/wizard.c2
18 files changed, 47 insertions, 47 deletions
diff --git a/usr.sbin/sade/command.c b/usr.sbin/sade/command.c
index 3e3d5c9..2242495 100644
--- a/usr.sbin/sade/command.c
+++ b/usr.sbin/sade/command.c
@@ -161,7 +161,7 @@ command_execute(void)
/* If it's a shell command, run system on it */
if (commandStack[i]->cmds[j].type == CMD_SHELL) {
msgNotify("Doing %s", commandStack[i]->cmds[j].ptr);
- ret = vsystem((char *)commandStack[i]->cmds[j].ptr);
+ ret = vsystem("%s", (char *)commandStack[i]->cmds[j].ptr);
if (isDebug())
msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
}
diff --git a/usr.sbin/sade/dispatch.c b/usr.sbin/sade/dispatch.c
index 6373476..0d1a67c 100644
--- a/usr.sbin/sade/dispatch.c
+++ b/usr.sbin/sade/dispatch.c
@@ -194,7 +194,7 @@ dispatch_msgConfirm(dialogMenuItem *unused)
char *msg = variable_get(VAR_COMMAND);
if (msg) {
- msgConfirm(msg);
+ msgConfirm("%s", msg);
return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c
index a027905..256346e 100644
--- a/usr.sbin/sade/msg.c
+++ b/usr.sbin/sade/msg.c
@@ -340,13 +340,13 @@ msgWeHaveOutput(char *fmt, ...)
int
msgSimpleConfirm(char *str)
{
- msgConfirm(str);
+ msgConfirm("%s", str);
return DITEM_SUCCESS;
}
int
msgSimpleNotify(char *str)
{
- msgNotify(str);
+ msgNotify("%s", str);
return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index 0f8fd75..13302a3 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -425,7 +425,7 @@ extern void mediaShutdownCDROM(Device *dev);
extern void command_clear(void);
extern void command_sort(void);
extern void command_execute(void);
-extern void command_shell_add(char *key, char *fmt, ...);
+extern void command_shell_add(char *key, char *fmt, ...) __printflike(2, 3);
extern void command_func_add(char *key, commandFunc func, void *data);
/* config.c */
@@ -679,18 +679,18 @@ extern int setMouseFlags(dialogMenuItem *self);
/* msg.c */
extern Boolean isDebug(void);
-extern void msgInfo(char *fmt, ...);
-extern void msgYap(char *fmt, ...);
-extern void msgWarn(char *fmt, ...);
-extern void msgDebug(char *fmt, ...);
-extern void msgError(char *fmt, ...);
-extern void msgFatal(char *fmt, ...);
-extern void msgConfirm(char *fmt, ...);
-extern void msgNotify(char *fmt, ...);
-extern void msgWeHaveOutput(char *fmt, ...);
-extern int msgYesNo(char *fmt, ...);
-extern int msgNoYes(char *fmt, ...);
-extern char *msgGetInput(char *buf, char *fmt, ...);
+extern void msgInfo(char *fmt, ...) __printf0like(1, 2);
+extern void msgYap(char *fmt, ...) __printflike(1, 2);
+extern void msgWarn(char *fmt, ...) __printflike(1, 2);
+extern void msgDebug(char *fmt, ...) __printflike(1, 2);
+extern void msgError(char *fmt, ...) __printflike(1, 2);
+extern void msgFatal(char *fmt, ...) __printflike(1, 2);
+extern void msgConfirm(char *fmt, ...) __printflike(1, 2);
+extern void msgNotify(char *fmt, ...) __printflike(1, 2);
+extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2);
+extern int msgYesNo(char *fmt, ...) __printflike(1, 2);
+extern int msgNoYes(char *fmt, ...) __printflike(1, 2);
+extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3);
extern int msgSimpleConfirm(char *);
extern int msgSimpleNotify(char *);
@@ -729,7 +729,7 @@ extern void systemChangeLang(char *lang);
extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]);
extern void systemChangeScreenmap(const u_char newmap[]);
extern void systemCreateHoloshell(void);
-extern int vsystem(char *fmt, ...);
+extern int vsystem(char *fmt, ...) __printflike(1, 2);
/* tape.c */
extern char *mediaTapeBlocksize(void);
diff --git a/usr.sbin/sade/variable.c b/usr.sbin/sade/variable.c
index 86429cd..ee56279 100644
--- a/usr.sbin/sade/variable.c
+++ b/usr.sbin/sade/variable.c
@@ -164,7 +164,7 @@ variable_get_value(char *var, char *prompt, int dirty)
cp = variable_get(var);
if (cp && variable_get(VAR_NONINTERACTIVE))
return cp;
- else if ((cp = msgGetInput(cp, prompt)) != NULL)
+ else if ((cp = msgGetInput(cp, "%s", prompt)) != NULL)
variable_set2(var, cp, dirty);
else
cp = NULL;
diff --git a/usr.sbin/sade/wizard.c b/usr.sbin/sade/wizard.c
index e499a27..ded9f3a 100644
--- a/usr.sbin/sade/wizard.c
+++ b/usr.sbin/sade/wizard.c
@@ -80,7 +80,7 @@ slice_wizard(Disk *d)
printf("%s",p);
free(p);
}
- printf(myprompt);
+ printf("%s", myprompt);
fflush(stdout);
q = p = fgets(input,sizeof(input),stdin);
if(!p)
diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c
index 70a0735..5291207 100644
--- a/usr.sbin/sysinstall/anonFTP.c
+++ b/usr.sbin/sysinstall/anonFTP.c
@@ -175,7 +175,7 @@ createFtpUser(void)
msgConfirm("Could not open master password file.");
return DITEM_FAILURE;
}
- fprintf(fptr, pwline);
+ fprintf(fptr, "%s", pwline);
fclose(fptr);
msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD);
vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD);
diff --git a/usr.sbin/sysinstall/command.c b/usr.sbin/sysinstall/command.c
index 3e3d5c9..2242495 100644
--- a/usr.sbin/sysinstall/command.c
+++ b/usr.sbin/sysinstall/command.c
@@ -161,7 +161,7 @@ command_execute(void)
/* If it's a shell command, run system on it */
if (commandStack[i]->cmds[j].type == CMD_SHELL) {
msgNotify("Doing %s", commandStack[i]->cmds[j].ptr);
- ret = vsystem((char *)commandStack[i]->cmds[j].ptr);
+ ret = vsystem("%s", (char *)commandStack[i]->cmds[j].ptr);
if (isDebug())
msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
}
diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c
index 6373476..0d1a67c 100644
--- a/usr.sbin/sysinstall/dispatch.c
+++ b/usr.sbin/sysinstall/dispatch.c
@@ -194,7 +194,7 @@ dispatch_msgConfirm(dialogMenuItem *unused)
char *msg = variable_get(VAR_COMMAND);
if (msg) {
- msgConfirm(msg);
+ msgConfirm("%s", msg);
return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c
index c30403a..ae6f6e4 100644
--- a/usr.sbin/sysinstall/index.c
+++ b/usr.sbin/sysinstall/index.c
@@ -530,7 +530,7 @@ pkg_selected(dialogMenuItem *self, int is_selected)
if (!is_selected || kp->type != PACKAGE)
return;
- msgInfo(kp->desc);
+ msgInfo("%s", kp->desc);
}
int
diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c
index a027905..256346e 100644
--- a/usr.sbin/sysinstall/msg.c
+++ b/usr.sbin/sysinstall/msg.c
@@ -340,13 +340,13 @@ msgWeHaveOutput(char *fmt, ...)
int
msgSimpleConfirm(char *str)
{
- msgConfirm(str);
+ msgConfirm("%s", str);
return DITEM_SUCCESS;
}
int
msgSimpleNotify(char *str)
{
- msgNotify(str);
+ msgNotify("%s", str);
return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index a535a40..a42cee0 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -114,7 +114,7 @@ mediaInitNetwork(Device *dev)
* for later killing. It's just too convenient to call vsystem(), however, rather than
* constructing a proper argument for exec() so we punt on doing slip right for now.
*/
- if (vsystem(attach)) {
+ if (vsystem("%s", attach)) {
msgConfirm("slattach returned a bad status! Please verify that\n"
"the command is correct and try this operation again.");
restorescr(w);
diff --git a/usr.sbin/sysinstall/pccard.c b/usr.sbin/sysinstall/pccard.c
index d0e6770..2a4dc2f 100644
--- a/usr.sbin/sysinstall/pccard.c
+++ b/usr.sbin/sysinstall/pccard.c
@@ -285,6 +285,6 @@ pccardInitialize(void)
variable_set2("pccardd_flags", card_irq, 1);
variable_set2("pccard_enable", "YES", 1);
- vsystem(pccardd_cmd);
+ vsystem("%s", pccardd_cmd);
restorescr(w);
}
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index 0f8fd75..13302a3 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -425,7 +425,7 @@ extern void mediaShutdownCDROM(Device *dev);
extern void command_clear(void);
extern void command_sort(void);
extern void command_execute(void);
-extern void command_shell_add(char *key, char *fmt, ...);
+extern void command_shell_add(char *key, char *fmt, ...) __printflike(2, 3);
extern void command_func_add(char *key, commandFunc func, void *data);
/* config.c */
@@ -679,18 +679,18 @@ extern int setMouseFlags(dialogMenuItem *self);
/* msg.c */
extern Boolean isDebug(void);
-extern void msgInfo(char *fmt, ...);
-extern void msgYap(char *fmt, ...);
-extern void msgWarn(char *fmt, ...);
-extern void msgDebug(char *fmt, ...);
-extern void msgError(char *fmt, ...);
-extern void msgFatal(char *fmt, ...);
-extern void msgConfirm(char *fmt, ...);
-extern void msgNotify(char *fmt, ...);
-extern void msgWeHaveOutput(char *fmt, ...);
-extern int msgYesNo(char *fmt, ...);
-extern int msgNoYes(char *fmt, ...);
-extern char *msgGetInput(char *buf, char *fmt, ...);
+extern void msgInfo(char *fmt, ...) __printf0like(1, 2);
+extern void msgYap(char *fmt, ...) __printflike(1, 2);
+extern void msgWarn(char *fmt, ...) __printflike(1, 2);
+extern void msgDebug(char *fmt, ...) __printflike(1, 2);
+extern void msgError(char *fmt, ...) __printflike(1, 2);
+extern void msgFatal(char *fmt, ...) __printflike(1, 2);
+extern void msgConfirm(char *fmt, ...) __printflike(1, 2);
+extern void msgNotify(char *fmt, ...) __printflike(1, 2);
+extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2);
+extern int msgYesNo(char *fmt, ...) __printflike(1, 2);
+extern int msgNoYes(char *fmt, ...) __printflike(1, 2);
+extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3);
extern int msgSimpleConfirm(char *);
extern int msgSimpleNotify(char *);
@@ -729,7 +729,7 @@ extern void systemChangeLang(char *lang);
extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]);
extern void systemChangeScreenmap(const u_char newmap[]);
extern void systemCreateHoloshell(void);
-extern int vsystem(char *fmt, ...);
+extern int vsystem(char *fmt, ...) __printflike(1, 2);
/* tape.c */
extern char *mediaTapeBlocksize(void);
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c
index fee6283..1cae6fb 100644
--- a/usr.sbin/sysinstall/tcpip.c
+++ b/usr.sbin/sysinstall/tcpip.c
@@ -113,7 +113,7 @@ static void
feepout(char *msg)
{
beep();
- msgConfirm(msg);
+ msgConfirm("%s", msg);
}
/* Verify IP address integrity */
diff --git a/usr.sbin/sysinstall/user.c b/usr.sbin/sysinstall/user.c
index f91087e..3e4a65c 100644
--- a/usr.sbin/sysinstall/user.c
+++ b/usr.sbin/sysinstall/user.c
@@ -171,7 +171,7 @@ verifyGroupSettings(void)
return 0;
}
snprintf(tmp, 256, "pw group show -q -n %s > /dev/null", gname);
- if (vsystem(tmp) == 0) {
+ if (vsystem("%s", tmp) == 0) {
feepout("This group name is already in use.");
return 0;
}
@@ -410,7 +410,7 @@ verifyUserSettings(WINDOW *ds_win)
return 0;
}
snprintf(tmp, 256, "pw user show -q -n %s > /dev/null", uname);
- if (vsystem(tmp) == 0) {
+ if (vsystem("%s", tmp) == 0) {
feepout("This user name is already in use.");
return 0;
}
diff --git a/usr.sbin/sysinstall/variable.c b/usr.sbin/sysinstall/variable.c
index 86429cd..ee56279 100644
--- a/usr.sbin/sysinstall/variable.c
+++ b/usr.sbin/sysinstall/variable.c
@@ -164,7 +164,7 @@ variable_get_value(char *var, char *prompt, int dirty)
cp = variable_get(var);
if (cp && variable_get(VAR_NONINTERACTIVE))
return cp;
- else if ((cp = msgGetInput(cp, prompt)) != NULL)
+ else if ((cp = msgGetInput(cp, "%s", prompt)) != NULL)
variable_set2(var, cp, dirty);
else
cp = NULL;
diff --git a/usr.sbin/sysinstall/wizard.c b/usr.sbin/sysinstall/wizard.c
index e499a27..ded9f3a 100644
--- a/usr.sbin/sysinstall/wizard.c
+++ b/usr.sbin/sysinstall/wizard.c
@@ -80,7 +80,7 @@ slice_wizard(Disk *d)
printf("%s",p);
free(p);
}
- printf(myprompt);
+ printf("%s", myprompt);
fflush(stdout);
q = p = fgets(input,sizeof(input),stdin);
if(!p)
OpenPOWER on IntegriCloud