From a5fb0d8c6c384b9ea1074fb469c0a3dd5b874e98 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 28 May 2009 23:18:22 +0200 Subject: [PATCH] Add some const where appropriate. --- lib/utils.c | 4 ++-- lib/utils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index 4b93b042..56bcb0b1 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -29,7 +29,7 @@ volatile char (*cp_file[]) = {"?", "?", "?", "?", "?", "?", "?", "?", "?", "?", volatile int cp_index = 0; #endif -char *hexadecimals = "0123456789ABCDEF"; +const char hexadecimals[] = "0123456789ABCDEF"; int charhex2bin(char c) { @@ -85,7 +85,7 @@ void cp_trace() #include #endif -char *winerror(int err) { +const char *winerror(int err) { static char buf[1024], *newline; if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, diff --git a/lib/utils.h b/lib/utils.h index 6ff20829..04c4ddbd 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -39,7 +39,7 @@ extern void hex2bin(char *src, char *dst, int length); extern void bin2hex(char *src, char *dst, int length); #ifdef HAVE_MINGW -extern char *winerror(int); +extern const char *winerror(int); #define strerror(x) ((x)>0?strerror(x):winerror(GetLastError())) #endif -- 2.39.5