diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/add.c | 2 | ||||
-rw-r--r-- | src/apk_print.h | 11 | ||||
-rw-r--r-- | src/package.c | 4 |
3 files changed, 10 insertions, 7 deletions
@@ -130,7 +130,7 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array if (APK_BLOB_IS_NULL(b) || virtdep.conflict || virtdep.result_mask != APK_DEPMASK_ANY || virtdep.version != &apk_null_blob) { - apk_error("%s: bad package specifier"); + apk_error("%s: bad package specifier", actx->virtpkg); return -1; } if (virtdep.name->name[0] != '.' && non_repository_check(db)) diff --git a/src/apk_print.h b/src/apk_print.h index 962ff69..b3df913 100644 --- a/src/apk_print.h +++ b/src/apk_print.h @@ -24,7 +24,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) @@ -32,8 +32,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); @@ -47,6 +49,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 diff --git a/src/package.c b/src/package.c index 262bda2..407211d 100644 --- a/src/package.c +++ b/src/package.c @@ -893,8 +893,8 @@ static int read_info_entry(void *ctx, const struct apk_file_info *ae, apk_blob_for_each_segment(blob, "\n", read_info_line, ctx); free(blob.ptr); } else if (strcmp(ae->name, ".INSTALL") == 0) { - apk_warning("Package '%s-%s' contains deprecated .INSTALL", - pkg->name->name, pkg->version); + apk_warning("Package '%s-" BLOB_FMT "' contains deprecated .INSTALL", + pkg->name->name, BLOB_PRINTF(*pkg->version)); } return 0; } |