From cee12fc60cd7f9fcff0f7447f3018f6eb0b125d1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 1 Aug 2011 13:17:54 +0200 Subject: ionice: fix compiler warnings [-Wsign-compare] Signed-off-by: Karel Zak --- schedutils/ionice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'schedutils') diff --git a/schedutils/ionice.c b/schedutils/ionice.c index 75f372e07..18529753f 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) -- cgit v1.2.3-55-g7522