From: Karel Zak Date: Mon, 1 Aug 2011 11:17:54 +0000 (+0200) Subject: ionice: fix compiler warnings [-Wsign-compare] X-Git-Tag: v2.20-rc2~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cee12fc60cd7f9fcff0f7447f3018f6eb0b125d1;p=thirdparty%2Futil-linux.git ionice: fix compiler warnings [-Wsign-compare] Signed-off-by: Karel Zak --- diff --git a/schedutils/ionice.c b/schedutils/ionice.c index 75f372e078..18529753f4 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -59,7 +59,7 @@ const char *to_prio[] = { static int parse_ioclass(const char *str) { - int i; + size_t i; for (i = 0; i < ARRAY_SIZE(to_prio); i++) if (!strcasecmp(str, to_prio[i])) @@ -77,7 +77,7 @@ static void ioprio_print(int pid) int ioclass = IOPRIO_PRIO_CLASS(ioprio); const char *name = _("unknown"); - if (ioclass < ARRAY_SIZE(to_prio)) + if (ioclass > 0 && (size_t) ioclass < ARRAY_SIZE(to_prio)) name = to_prio[ioclass]; if (ioclass != IOPRIO_CLASS_IDLE)