From e8cd34f2439ebb4601c8bda1be51cd94029547c0 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Thu, 14 Aug 2008 14:51:47 +0000 Subject: [PATCH] libcgroup: beautify strcpy in modify_cgroup The code looked ugly. De-uglyfy it. Signed-off-by: Dhaval Giani git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@151 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- api.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api.c b/api.c index e0a7b118..d82ec799 100644 --- a/api.c +++ b/api.c @@ -517,15 +517,15 @@ int cgroup_modify_cgroup(struct cgroup *cgroup) } } - for (i = 0, strcpy(path, base); i < cgroup->index; - i++, strcpy(path, base)) { + strcpy(path, base); + for (i = 0; i < cgroup->index; i++, strcpy(path, base)) { int j; if (!cg_build_path(cgroup->name, base, cgroup->controller[i]->name)) continue; - for (j = 0, strcpy(path, base); - j < cgroup->controller[i]->index; - j++, strcpy(path, base)) { + strcpy(path, base); + for (j = 0; j < cgroup->controller[i]->index; + j++, strcpy(path, base)) { strcat(path, cgroup->controller[i]->values[j]->name); error = cg_set_control_value(path, cgroup->controller[i]->values[j]->value); -- 2.47.2