From 60e74d48cd8c59f412128d98908f2b04b2b07586 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 6 Feb 2018 22:44:11 -0800 Subject: Fix const correctness for path_extension --HG-- branch : nuklear_ui --- util.c | 8 ++++---- util.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util.c b/util.c index 96840e5..5d2925e 100644 --- a/util.c +++ b/util.c @@ -250,11 +250,11 @@ char * basename_no_extension(char *path) return barename; } -char *path_extension(char *path) +char *path_extension(char const *path) { - char *lastdot = NULL; - char *lastslash = NULL; - char *cur; + char const *lastdot = NULL; + char const *lastslash = NULL; + char const *cur; for (cur = path; *cur; cur++) { if (*cur == '.') { diff --git a/util.h b/util.h index 516aba3..01c360b 100644 --- a/util.h +++ b/util.h @@ -41,7 +41,7 @@ char is_absolute_path(char *path); //Returns the basename of a path with th extension (if any) stripped char * basename_no_extension(char *path); //Returns the extension from a path or NULL if there is no extension -char *path_extension(char *path); +char *path_extension(char const *path); //Returns true if the given path matches one of the extensions in the list uint8_t path_matches_extensions(char *path, char **ext_list, uint32_t num_exts); //Returns the directory portion of a path or NULL if there is no directory part -- cgit v1.2.3