aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2018-03-21 01:50:56 -0700
committerkatherine <shmibs@shmibbles.me>2018-03-21 01:50:56 -0700
commitd2043c1d4cc0a1ec2d7c4b2ed7f9b6d529514172 (patch)
tree5eaa340e7b4bf3f916c998e01c777984273b164d
parent810a5d355c14a2021b3fee539568a0dfef27d766 (diff)
downloadsimple-opt-d2043c1d4cc0a1ec2d7c4b2ed7f9b6d529514172.tar.gz
squanch clang errors
-rw-r--r--README.md2
-rw-r--r--doc/example.c2
-rw-r--r--simple-opt.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index c597fee..4d0dfe9 100644
--- a/README.md
+++ b/README.md
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
/* if any non-option arguments were passed, print them */
if (result.argc > 0) {
- printf("\nnon-options:", result.argc);
+ printf("\nnon-options:");
for (i = 0; i < result.argc; i++)
printf(" %s", result.argv[i]);
diff --git a/doc/example.c b/doc/example.c
index 2ff562d..e62e73f 100644
--- a/doc/example.c
+++ b/doc/example.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
/* if any non-option arguments were passed, print them */
if (result.argc > 0) {
- printf("\nnon-options:", result.argc);
+ printf("\nnon-options:");
for (i = 0; i < result.argc; i++)
printf(" %s", result.argv[i]);
diff --git a/simple-opt.h b/simple-opt.h
index d250e73..ada6233 100644
--- a/simple-opt.h
+++ b/simple-opt.h
@@ -660,7 +660,7 @@ static void simple_opt_print_usage(FILE *f, unsigned width, char *usage_name,
if (options[i].type != SIMPLE_OPT_FLAG) {
if (options[i].custom_arg_string != NULL) {
sprintf(print_buffer + print_buffer_offset,
- options[i].custom_arg_string);
+ "%s", options[i].custom_arg_string);
print_buffer_offset += strlen(options[i].custom_arg_string);
} else {
switch (options[i].type) {