char **aret = NULL;
for (i = 0; i < 4; i++) {
- p = index(p, ' ');
+ p = strchr(p, ' ');
if (!p)
return NULL;
p++;
if (strncmp(p, "/sys/fs/cgroup/", 15) != 0)
return NULL;
p += 15;
- p2 = index(p, ' ');
+ p2 = strchr(p, ' ');
if (!p2) {
ERROR("corrupt mountinfo");
return NULL;
size_t len;
for (i = 0; i < 4; i++) {
- p = index(p, ' ');
+ p = strchr(p, ' ');
if (!p)
return NULL;
p++;
*/
static char *copy_to_eol(char *p)
{
- char *p2 = index(p, '\n'), *sret;
+ char *p2 = strchr(p, '\n'), *sret;
size_t len;
if (!p2)
char *tok, *saveptr = NULL, *eol, *tmp;
size_t len;
- eol = index(cgline, ':');
+ eol = strchr(cgline, ':');
if (!eol)
return false;
char *p = basecginfo;
while (1) {
- p = index(p, ':');
+ p = strchr(p, ':');
if (!p)
return NULL;
p++;
if (controller_in_clist(p, controller)) {
- p = index(p, ':');
+ p = strchr(p, ':');
if (!p)
return NULL;
p++;
return copy_to_eol(p);
}
- p = index(p, '\n');
+ p = strchr(p, '\n');
if (!p)
return NULL;
p++;
return;
while (getline(&line, &len, f) != -1) {
char *p, *p2, *tok, *saveptr = NULL;
- p = index(line, ':');
+ p = strchr(line, ':');
if (!p)
continue;
p++;
- p2 = index(p, ':');
+ p2 = strchr(p, ':');
if (!p2)
continue;
*p2 = '\0';