Skip to content

Commit

Permalink
Fix harmless -Wsign-compare warning
Browse files Browse the repository at this point in the history
`sizeof(buf) == 128` so the signed comparison is always within range.
  • Loading branch information
bnoordhuis committed Nov 17, 2024
1 parent e1a0f4f commit 79437f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 79437f6

Please sign in to comment.