From: Michael Schroeder Date: Wed, 29 Apr 2026 09:27:43 +0000 (+0200) Subject: Use size_t in pool_id2langid X-Git-Tag: 0.7.38~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=379bee2a59490ef9e72185b1db11f2ee2bff52cc;p=thirdparty%2Flibsolv.git Use size_t in pool_id2langid Should not matter, but it is more correct. --- diff --git a/src/pool.c b/src/pool.c index bae5b594..9aea1ac5 100644 --- a/src/pool.c +++ b/src/pool.c @@ -450,14 +450,14 @@ pool_id2langid(Pool *pool, Id id, const char *lang, int create) { const char *n; char buf[256], *p; - int l; + size_t l; if (!lang || !*lang) return id; n = pool_id2str(pool, id); l = strlen(n) + strlen(lang) + 2; if (l > sizeof(buf)) - p = solv_malloc(strlen(n) + strlen(lang) + 2); + p = solv_malloc(l); else p = buf; sprintf(p, "%s:%s", n, lang); @@ -471,7 +471,7 @@ char * pool_alloctmpspace(Pool *pool, int len) { int n = pool->tmpspace.n; - if (!len) + if (len <= 0) return 0; if (len > pool->tmpspace.len[n]) { @@ -586,7 +586,7 @@ const char * pool_bin2hex(Pool *pool, const unsigned char *buf, int len) { char *s; - if (!len) + if (len <= 0) return ""; s = pool_alloctmpspace(pool, 2 * len + 1); solv_bin2hex(buf, len, s);