From: Dhaval Giani Date: Mon, 17 May 2010 16:15:58 +0000 (+0200) Subject: libcgroup: Fix warnings warning about comparisions between signed and unsigned integers X-Git-Tag: v0.36~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90a72cad235b47ad7fb0d1c3789ad9037c9ebdd0;p=thirdparty%2Flibcgroup.git libcgroup: Fix warnings warning about comparisions between signed and unsigned integers Fix warnings such as api.c:539: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] api.c:539: warning: signed and unsigned type in conditional expression [-Wsign-compare] Signed-off-by: Dhaval Giani --- diff --git a/src/api.c b/src/api.c index f09f0c2f..672243fe 100644 --- a/src/api.c +++ b/src/api.c @@ -330,7 +330,7 @@ static int cgroup_parse_rules(bool cache, uid_t muid, char destination[FILENAME_MAX] = { '\0' }; uid_t uid = CGRULE_INVALID; gid_t gid = CGRULE_INVALID; - int len_username; + size_t len_username; int len_procname; /* The current line number */ @@ -536,7 +536,8 @@ static int cgroup_parse_rules(bool cache, uid_t muid, newrule->uid = uid; newrule->gid = gid; - len_username = min(len_username, sizeof(newrule->username) - 1); + len_username = min(len_username, + sizeof(newrule->username) - 1); strncpy(newrule->username, user, len_username); if (len_procname) { newrule->procname = strdup(procname);