From c7d536bbcd612e45956d2cfd6f23281226ab60bd Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Wed, 1 Feb 2017 18:08:46 +0200 Subject: [PATCH] Fix OS-X compiler warning cfg.c:1024:74: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned long long' [-Wformat] fprintf(stderr, "Too large ROI size: %llu (maximum %zu).\n", size, SIZE_MAX); --- src/cfg.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index df200373..dfd3c4df 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -1018,12 +1018,11 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value) return 0; } - const long long unsigned size = (long long unsigned) width * - (long long unsigned) height; - if (size > SIZE_MAX) { - fprintf(stderr, "Too large ROI size: %llu (maximum %zu).\n", size, SIZE_MAX); + if (width > 10000 || height > 10000) { + fprintf(stderr, "ROI dimensions exceed arbitrary value of 10000.\n"); return 0; } + const unsigned size = width * height; cfg->roi.width = width; cfg->roi.height = height;