Refactor !!x to x != 0

Also limit comments and docs to single "!"s
This commit is contained in:
Rangi
2022-10-01 14:09:02 -04:00
parent 969412af24
commit a1107fc5cf
8 changed files with 10 additions and 10 deletions

View File

@@ -249,7 +249,7 @@ void fmt_PrintNumber(char *buf, size_t bufLen, struct FormatSpec const *fmt, uin
}
size_t len = strlen(valueBuf);
size_t numLen = !!sign + !!prefix + len;
size_t numLen = (sign != 0) + (prefix != 0) + len;
size_t totalLen = fmt->width > numLen ? fmt->width : numLen;
if (totalLen > bufLen - 1) { // bufLen includes terminator