diff --git a/src/apps/netbiosns/netbiosns.c b/src/apps/netbiosns/netbiosns.c index 4b5cdb87..e1dd3157 100644 --- a/src/apps/netbiosns/netbiosns.c +++ b/src/apps/netbiosns/netbiosns.c @@ -499,7 +499,7 @@ netbiosns_set_name(const char *hostname) /* make name into upper case */ for (i = 0; i < copy_len; i++ ) { - netbiosns_local_name[i] = (char)toupper((unsigned char)hostname[i]); + netbiosns_local_name[i] = (char)lwip_toupper(hostname[i]); } netbiosns_local_name[copy_len] = '\0'; } diff --git a/src/include/lwip/arch.h b/src/include/lwip/arch.h index aa45bee3..ba6204ed 100644 --- a/src/include/lwip/arch.h +++ b/src/include/lwip/arch.h @@ -223,6 +223,7 @@ typedef int ssize_t; #define lwip_isspace(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || (c) == '\t' || (c) == '\v') #define lwip_isupper(c) lwip_in_range((c), 'A', 'Z') #define lwip_tolower(c) (lwip_isupper(c) ? (c) - 'A' + 'a' : c) +#define lwip_toupper(c) (lwip_islower(c) ? (c) - 'a' + 'A' : c) #else #include #define lwip_isdigit(c) isdigit((unsigned char)(c)) @@ -230,6 +231,7 @@ typedef int ssize_t; #define lwip_islower(c) islower((unsigned char)(c)) #define lwip_isspace(c) isspace((unsigned char)(c)) #define lwip_tolower(c) tolower((unsigned char)(c)) +#define lwip_toupper(c) toupper((unsigned char)(c)) #endif /** C++ const_cast(val) equivalent to remove constness from a value (GCC -Wcast-qual) */