It is best practice to use const for immutable parameters (c.f. libc's
string functions).

Signed-off-by: Michael Adler <[email protected]>
---
 env/env_api.c     | 4 ++--
 include/env_api.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/env/env_api.c b/env/env_api.c
index 3e39084..1fad1d7 100644
--- a/env/env_api.c
+++ b/env/env_api.c
@@ -26,7 +26,7 @@
  * Thus, the needed conversion by truncation function is
  * reimplemented here.
  */
-char *str16to8(char *buffer, wchar_t *src)
+char *str16to8(char *buffer, const wchar_t *src)
 {
        if (!src || !buffer) {
                return NULL;
@@ -41,7 +41,7 @@ char *str16to8(char *buffer, wchar_t *src)
        return tmp;
 }
 
-wchar_t *str8to16(wchar_t *buffer, char *src)
+wchar_t *str8to16(wchar_t *buffer, const char *src)
 {
        if (!src || !buffer) {
                return NULL;
diff --git a/include/env_api.h b/include/env_api.h
index bcd45d2..90a0568 100644
--- a/include/env_api.h
+++ b/include/env_api.h
@@ -74,8 +74,8 @@ typedef struct gc_item {
 
 extern void bgenv_be_verbose(bool v);
 
-extern char *str16to8(char *buffer, wchar_t *src);
-extern wchar_t *str8to16(wchar_t *buffer, char *src);
+extern char *str16to8(char *buffer, const wchar_t *src);
+extern wchar_t *str8to16(wchar_t *buffer, const char *src);
 
 extern bool bgenv_init(void);
 extern void bgenv_finalize(void);
-- 
2.33.0

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20211018120340.1001517-1-michael.adler%40siemens.com.

Reply via email to