diff --git a/proc/readproc.c b/proc/readproc.c index fc66d0cf..6c986266 100644 --- a/proc/readproc.c +++ b/proc/readproc.c @@ -1077,11 +1077,8 @@ static void autogroup_fill (const char *path, proc_t *p) { close(fd); if (in > 0) { buf[in] = '\0'; - if ((str = strstr(buf, "-"))) - p->autogrp_id = atoi(++str); - if ((str = strstr(buf, "nice"))) - p->autogrp_nice = atoi(str + sizeof("nice")); - // above sizeof includes null, skips space ahead of # + sscanf(buf, "/autogroup-%d nice %d" + , &p->autogrp_id, &p->autogrp_nice); } } }