From: Guido Vranken Date: Wed, 7 Jun 2017 22:44:15 +0000 (+0200) Subject: refactor my_strupr X-Git-Tag: v2.5_beta1~686 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69162924de3600bfe8ae9708a1d6e3f4515ef995;p=thirdparty%2Fopenvpn.git refactor my_strupr Refactor my_strupr such that it will not check and possibly alter bytes after the string's null terminator for strings of length 0. Signed-off-by: Guido Vranken Acked-by: Gert Doering Message-Id: URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14756.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/ntlm.c b/src/openvpn/ntlm.c index 0c436812e..93483379b 100644 --- a/src/openvpn/ntlm.c +++ b/src/openvpn/ntlm.c @@ -130,17 +130,16 @@ gen_nonce(unsigned char *nonce) } } -unsigned char * +void my_strupr(unsigned char *str) { /* converts string to uppercase in place */ - unsigned char *tmp = str; - do + while (*str) { *str = toupper(*str); - } while (*(++str)); - return tmp; + str++; + } } static int