From add4d5d325794203e7894ec0ebda489a75f91752 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 31 Oct 2017 21:05:13 +0100 Subject: [PATCH] Fix #8: constify mkpath() and makepath() Signed-off-by: Joachim Nilsson --- lite.h | 4 ++-- makepath.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lite.h b/lite.h index c714041..fa06d6a 100644 --- a/lite.h +++ b/lite.h @@ -67,8 +67,8 @@ char *lfgetkey (lfile_t *lf, char *key); int lfgetint (lfile_t *lf, char *key); int fgetint (char *file, char *sep, char *key); -int mkpath (char *dir, mode_t mode); -int makepath (char *dir); +int mkpath (const char *dir, mode_t mode); +int makepath (const char *dir); int dir (const char *dir, const char *type, int (*filter) (const char *file), char ***list, int strip); int rsync (char *src, char *dst, int delete, int (*filter) (const char *file)); diff --git a/makepath.c b/makepath.c index a78c2cc..5185ee6 100644 --- a/makepath.c +++ b/makepath.c @@ -29,7 +29,7 @@ * Returns: * POSIX OK(0) on success, otherwise -1 with @errno set. */ -int mkpath(char *dir, mode_t mode) +int mkpath(const char *dir, mode_t mode) { struct stat sb; @@ -56,7 +56,7 @@ int mkpath(char *dir, mode_t mode) * fails allocating temporary memory. For other error codes see the * mkdir() syscall description. */ -int makepath(char *dir) +int makepath(const char *dir) { return mkpath(dir, 0777); }