if (!f)
exit(1);
while (getline(&line, &linelen, f) != -1) {
- sp1 = index(line, ' ');
+ sp1 = strchr(line, ' ');
if (!sp1)
exit(1);
*sp1 = '\0';
if (strcmp(line, l))
continue;
- sp2 = index(sp1+1, ' ');
+ sp2 = strchr(sp1+1, ' ');
if (!sp2)
exit(1);
*sp2 = '\0';
- sp3 = index(sp2+1, ' ');
+ sp3 = strchr(sp2+1, ' ');
if (!sp3)
exit(1);
*sp3 = '\0';
if (zfs_list_entry(opath, output, MAXPATHLEN)) {
// zfsroot is output up to ' '
- if ((p = index(output, ' ')) == NULL)
+ if ((p = strchr(output, ' ')) == NULL)
return -1;
*p = '\0';
if ((p = strrchr(output, '/')) == NULL)
}
// zfs mount is output up to ' '
- if ((p = index(output, ' ')) == NULL)
+ if ((p = strchr(output, ' ')) == NULL)
return -1;
*p = '\0';
// mount -t overlayfs -oupperdir=${upper},lowerdir=${lower} lower dest
dup = alloca(strlen(bdev->src)+1);
strcpy(dup, bdev->src);
- if (!(lower = index(dup, ':')))
+ if (!(lower = strchr(dup, ':')))
return -22;
- if (!(upper = index(++lower, ':')))
+ if (!(upper = strchr(++lower, ':')))
return -22;
*upper = '\0';
upper++;
int len, ret, lastslashidx;
if (!(osrc = strdup(orig->src)))
return -22;
- nsrc = index(osrc, ':') + 1;
- if (nsrc != osrc + 10 || (odelta = index(nsrc, ':')) == NULL) {
+ nsrc = strchr(osrc, ':') + 1;
+ if (nsrc != osrc + 10 || (odelta = strchr(nsrc, ':')) == NULL) {
free(osrc);
return -22;
}
if (strncmp(orig->src, "overlayfs:", 10) != 0)
return -22;
- upper = index(orig->src + 10, ':');
+ upper = strchr(orig->src + 10, ':');
if (!upper)
return -22;
upper++;
// mount -t aufs -obr=${upper}=rw:${lower}=ro lower dest
dup = alloca(strlen(bdev->src)+1);
strcpy(dup, bdev->src);
- if (!(lower = index(dup, ':')))
+ if (!(lower = strchr(dup, ':')))
return -22;
- if (!(upper = index(++lower, ':')))
+ if (!(upper = strchr(++lower, ':')))
return -22;
*upper = '\0';
upper++;
int len, ret;
if (!(osrc = strdup(orig->src)))
return -22;
- nsrc = index(osrc, ':') + 1;
- if (nsrc != osrc + 5 || (odelta = index(nsrc, ':')) == NULL) {
+ nsrc = strchr(osrc, ':') + 1;
+ if (nsrc != osrc + 5 || (odelta = strchr(nsrc, ':')) == NULL) {
free(osrc);
return -22;
}
if (strncmp(orig->src, "aufs:", 5) != 0)
return -22;
- upper = index(orig->src + 5, ':');
+ upper = strchr(orig->src + 5, ':');
if (!upper)
return -22;
upper++;
}
// -B lvm,dir
- if (index(type, ',') != NULL) {
+ if (strchr(type, ',') != NULL) {
char *dup = alloca(strlen(type)+1), *saveptr = NULL, *token;
strcpy(dup, type);
for (token = strtok_r(dup, ",", &saveptr); token;
char *overlay_getlower(char *p)
{
- char *p1 = index(p, ':');
+ char *p1 = strchr(p, ':');
if (p1)
*p1 = '\0';
return p;
subsystem = alloca(strlen(filename) + 1);
strcpy(subsystem, filename);
- if ((p = index(subsystem, '.')) != NULL)
+ if ((p = strchr(subsystem, '.')) != NULL)
*p = '\0';
path = lxc_cgroup_get_hierarchy_abs_path_data(subsystem, d);
subsystem = alloca(strlen(filename) + 1);
strcpy(subsystem, filename);
- if ((p = index(subsystem, '.')) != NULL)
+ if ((p = strchr(subsystem, '.')) != NULL)
*p = '\0';
path = lxc_cgroup_get_hierarchy_abs_path(subsystem, name, lxcpath);
subsystem = alloca(strlen(filename) + 1);
strcpy(subsystem, filename);
- if ((p = index(subsystem, '.')) != NULL)
+ if ((p = strchr(subsystem, '.')) != NULL)
*p = '\0';
path = lxc_cgroup_get_hierarchy_abs_path(subsystem, name, lxcpath);