@@ -827,7 +827,7 @@ static void display_policycaps(policydb_t * p, FILE * fp)
ebitmap_for_each_positive_bit(&p->policycaps, node, i) {
capname = sepol_polcap_getname(i);
if (capname == NULL) {
- snprintf(buf, sizeof(buf), "unknown (%d)", i);
+ snprintf(buf, sizeof(buf), "unknown (%u)", i);
capname = buf;
}
fprintf(fp, "\t%s\n", capname);
@@ -285,7 +285,7 @@ static void display_policycaps(policydb_t * p, FILE * fp)
ebitmap_for_each_positive_bit(&p->policycaps, node, i) {
capname = sepol_polcap_getname(i);
if (capname == NULL) {
- snprintf(buf, sizeof(buf), "unknown (%d)", i);
+ snprintf(buf, sizeof(buf), "unknown (%u)", i);
capname = buf;
}
fprintf(fp, "\t%s\n", capname);
test/dispol.c:288:4: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] snprintf(buf, sizeof(buf), "unknown (%d)", i); ^ test/dismod.c:830:4: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] snprintf(buf, sizeof(buf), "unknown (%d)", i); ^ Found by Cppcheck. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- checkpolicy/test/dismod.c | 2 +- checkpolicy/test/dispol.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)