summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-09-08 21:39:28 -0700
committerBrian Behlendorf <[email protected]>2010-09-08 21:39:28 -0700
commit8ec8000f95d60daa51f670fd46930a2cec6accae (patch)
treea15f19d7a943868636347e0bb5d7369e2b832b57 /lib
parent6283f55ea1b91e680386388c17d14b89e344fa8d (diff)
Fix "format not a string literal" warning
Under Ubuntu 10.04 the default compiler flags include -Wformat and -Wformat-security which cause the above warning. In particular, cases where "%s" was forgotten as part of the format specifier. https://wiki.ubuntu.com/CompilerFlags
Diffstat (limited to 'lib')
-rw-r--r--lib/libnvpair/libnvpair.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libnvpair/libnvpair.c b/lib/libnvpair/libnvpair.c
index f669f9a89..606a919a4 100644
--- a/lib/libnvpair/libnvpair.c
+++ b/lib/libnvpair/libnvpair.c
@@ -123,7 +123,7 @@ struct nvlist_prtctl {
(void) DFLTPRTOP(pctl, type)(pctl, \
DFLTPRTOPARG(pctl, type), nvl, name, val); \
} \
- (void) fprintf(pctl->nvprt_fp, pctl->nvprt_eomfmt); \
+ (void) fprintf(pctl->nvprt_fp, "%s", pctl->nvprt_eomfmt); \
}
#define ARENDER(pctl, type, nvl, name, arrp, count) \
@@ -137,7 +137,7 @@ struct nvlist_prtctl {
(void) DFLTPRTOP(pctl, type)(pctl, \
DFLTPRTOPARG(pctl, type), nvl, name, arrp, count); \
} \
- (void) fprintf(pctl->nvprt_fp, pctl->nvprt_eomfmt); \
+ (void) fprintf(pctl->nvprt_fp, "%s", pctl->nvprt_eomfmt); \
}
static void nvlist_print_with_indent(nvlist_t *, nvlist_prtctl_t);
@@ -235,7 +235,7 @@ nvaprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \
(void) fprintf(fp, "[%d]: ", i); \
} \
if (i != 0) \
- (void) fprintf(fp, pctl->nvprt_btwnarrfmt); \
+ (void) fprintf(fp, "%s", pctl->nvprt_btwnarrfmt); \
(void) fprintf(fp, vfmt, (ptype)valuep[i]); \
} \
return (1); \
@@ -394,11 +394,11 @@ nvlist_prtctl_dofmt(nvlist_prtctl_t pctl, enum nvlist_prtctl_fmt which, ...)
break;
case NVLIST_FMT_MEMBER_POSTAMBLE:
- (void) fprintf(fp, pctl->nvprt_eomfmt);
+ (void) fprintf(fp, "%s", pctl->nvprt_eomfmt);
break;
case NVLIST_FMT_BTWN_ARRAY:
- (void) fprintf(fp, pctl->nvprt_btwnarrfmt); \
+ (void) fprintf(fp, "%s", pctl->nvprt_btwnarrfmt);
break;
default: