From: Guus Sliepen Date: Thu, 28 May 2009 21:18:22 +0000 (+0200) Subject: Add some const where appropriate. X-Git-Tag: release-1.0.10~56 X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=a5fb0d8c6c384b9ea1074fb469c0a3dd5b874e98 Add some const where appropriate. --- 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