summaryrefslogtreecommitdiffstats
path: root/lib/system/system.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-26 10:32:18 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-09-26 15:13:20 +0800
commit2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1 (patch)
treea3e44ccc6044dd31c35f3e078fd983777f9697aa /lib/system/system.c
parent98f2640cd6778362bb600abc7ea3bd3922a9f9e4 (diff)
downloadtalos-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.c6
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;
OpenPOWER on IntegriCloud