From 611ce460fb8bf4f1cc9d73925c0534f4ee3dc67c Mon Sep 17 00:00:00 2001 From: Sani7 Date: Fri, 8 Dec 2023 18:21:18 +0100 Subject: [PATCH] llfs Add const to llfs_get_filename_ext --- project/Core/Inc/llfs.h | 4 ++-- project/Core/Src/llfs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project/Core/Inc/llfs.h b/project/Core/Inc/llfs.h index 4707873..5b30d0d 100644 --- a/project/Core/Inc/llfs.h +++ b/project/Core/Inc/llfs.h @@ -86,8 +86,8 @@ size_t llfs_file_count(void); /** * @brief This function returns the extension of a file * @param[in] filename The filename to get the extension from - * @return char* The extension of the file + * @return const char* The extension of the file */ -char* llfs_get_filename_ext(char* filename); +const char* llfs_get_filename_ext(const char* filename); #endif // LLFS_H diff --git a/project/Core/Src/llfs.c b/project/Core/Src/llfs.c index 4c43fe6..352813a 100644 --- a/project/Core/Src/llfs.c +++ b/project/Core/Src/llfs.c @@ -141,7 +141,7 @@ size_t llfs_file_count(void) { return file_count; } -char* llfs_get_filename_ext(char* filename) { +const char* llfs_get_filename_ext(const char* filename) { char* dot = strrchr(filename, '.'); if (dot == NULL || dot == filename) return NULL;