Skip to content

Commit

Permalink
Fix harmless -Wsign-compare warning (#699)
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 authored Nov 17, 2024
1 parent e1a0f4f commit 974f40a
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 974f40a

Please sign in to comment.