Skip to content

Commit

Permalink
Merge pull request #265 from eriksjolund/handle-empty-basedir-option
Browse files Browse the repository at this point in the history
mountcomposefs: Handle empty basedir option
  • Loading branch information
cgwalters authored Mar 25, 2024
2 parents 301b78f + a96f786 commit 1179638
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/mountcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@ int main(int argc, char **argv)
if (options.objdirs == NULL)
errx(EXIT_FAILURE, "Out of memory\n");

for (i = 0, str = (char *)opt_basedir;; i++, str = NULL) {
for (i = 0, str = (char *)opt_basedir; i < options.n_objdirs;
i++, str = NULL) {
token = strtok_r(str, ":", &saveptr);
if (token == NULL)
break;
errx(EXIT_FAILURE,
"Value for basedir option has incorrect format\n");
options.objdirs[i] = token;
}
}
Expand Down

0 comments on commit 1179638

Please sign in to comment.