Fix inconsequential bug in bitmap_scnprintf
Fix incorrect code in bitmap_scnprintf that could cause it to give truncated output when nmaskbits > 32 and nmaskbits % 32 != 0. In practice this problem was never encountered because NR_CPUS % 32 == 0. So this change fixes the code for the sake of correctness even though the bug did not actually cause a real problem.
This commit is contained in:
parent
6190d1b074
commit
a01af53a53
2
bitmap.c
2
bitmap.c
|
@ -291,10 +291,10 @@ int bitmap_scnprintf(char *buf, unsigned int buflen,
|
||||||
if (val!=0 || !first || i==0) {
|
if (val!=0 || !first || i==0) {
|
||||||
len += snprintf(buf+len, buflen-len, "%s%0*lx", sep,
|
len += snprintf(buf+len, buflen-len, "%s%0*lx", sep,
|
||||||
(chunksz+3)/4, val);
|
(chunksz+3)/4, val);
|
||||||
chunksz = CHUNKSZ;
|
|
||||||
sep = ",";
|
sep = ",";
|
||||||
first = 0;
|
first = 0;
|
||||||
}
|
}
|
||||||
|
chunksz = CHUNKSZ;
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue