Fix harmless -Wsign-compare warning (#699)

`sizeof(buf) == 128` so the signed comparison is always within range.
This commit is contained in:
Ben Noordhuis 2024-11-17 23:21:03 +01:00 committed by GitHub
parent e1a0f4f1cf
commit 974f40a1a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -190,7 +190,7 @@ int __attribute__((format(printf, 2, 3))) dbuf_printf(DynBuf *s,
va_start(ap, fmt);
len = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if (len < sizeof(buf)) {
if (len < (int)sizeof(buf)) {
/* fast case */
return dbuf_put(s, (uint8_t *)buf, len);
} else {