diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-07-26 10:25:23 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-07-26 10:32:05 +0300 |
commit | 0eac0ed5f5575e4e115cc6a002b05e59d7f98f55 (patch) | |
tree | 98dd4462056b357d5aeae1b81010866f0dbe30df /src/apk_print.h | |
parent | 9e54fcf4be0d62e13e5a6fed481a1c08cd59c871 (diff) | |
download | apk-tools-0eac0ed5f5575e4e115cc6a002b05e59d7f98f55.tar.gz apk-tools-0eac0ed5f5575e4e115cc6a002b05e59d7f98f55.tar.bz2 apk-tools-0eac0ed5f5575e4e115cc6a002b05e59d7f98f55.tar.xz apk-tools-0eac0ed5f5575e4e115cc6a002b05e59d7f98f55.zip |
Use __attribute__ ((format)) where possible and fix issues found by it
Diffstat (limited to 'src/apk_print.h')
-rw-r--r-- | src/apk_print.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/apk_print.h b/src/apk_print.h index 8e4dd46..1d5dfd6 100644 --- a/src/apk_print.h +++ b/src/apk_print.h @@ -22,7 +22,7 @@ struct apk_url_print { void apk_url_parse(struct apk_url_print *, const char *); #define URL_FMT "%.*s%s%s" -#define URL_PRINTF(u) u.len_before_pw, u.url, u.pwmask, u.url_or_host +#define URL_PRINTF(u) (int)u.len_before_pw, u.url, u.pwmask, u.url_or_host #define apk_error(args...) do { apk_log_err("ERROR: ", args); } while (0) #define apk_warning(args...) do { if (apk_verbosity > 0) { apk_log_err("WARNING: ", args); } } while (0) @@ -30,8 +30,10 @@ void apk_url_parse(struct apk_url_print *, const char *); extern int apk_progress_fd; -void apk_log(const char *prefix, const char *format, ...); -void apk_log_err(const char *prefix, const char *format, ...); +void apk_log(const char *prefix, const char *format, ...) + __attribute__ ((format (printf, 2, 3))); +void apk_log_err(const char *prefix, const char *format, ...) + __attribute__ ((format (printf, 2, 3))); const char *apk_error_str(int error); void apk_reset_screen_width(void); @@ -46,6 +48,7 @@ struct apk_indent { void apk_print_progress(size_t done, size_t total); int apk_print_indented(struct apk_indent *i, apk_blob_t blob); void apk_print_indented_words(struct apk_indent *i, const char *text); -void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...); +void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); #endif |