From 2e97d0eea0d8a480877a1aabb4c67ad1aad59ed1 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 26 Sep 2013 10:32:18 +0800 Subject: [PATCH] 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 --- lib/system/system.c | 6 +++--- 1 file 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; -- 2.39.2