diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-09-26 10:32:18 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-09-26 15:13:20 +0800 |
commit | 2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1 (patch) | |
tree | a3e44ccc6044dd31c35f3e078fd983777f9697aa /lib/system/system.c | |
parent | 98f2640cd6778362bb600abc7ea3bd3922a9f9e4 (diff) | |
download | talos-petitboot-2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1.tar.gz talos-petitboot-2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1.zip |
lib/system: Don't modify dir parameter to pb_rmdir_recursive
We're modifying dir rather than cur (the local copy of dir), so the
caller-provided (const!) string is no longer const.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/system/system.c')
-rw-r--r-- | lib/system/system.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/system/system.c b/lib/system/system.c index c9fe979..0253ac8 100644 --- a/lib/system/system.c +++ b/lib/system/system.c @@ -91,12 +91,12 @@ int pb_rmdir_recursive(const char *base, const char *dir) cur = talloc_strdup(NULL, dir); - while (strcmp(base, dir)) { + while (strcmp(base, cur)) { - rmdir(dir); + rmdir(cur); /* null-terminate at the last slash */ - pos = strrchr(dir, '/'); + pos = strrchr(cur, '/'); if (!pos) break; |