Permalink
Browse files

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 <guidovranken@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <CAO5O-ELXwXgGtRFou=FY1TAhW4W4BHPZF4=rqSY877njtXNMJg@mail.gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14756.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
  • Loading branch information...
guidovranken authored and cron2 committed Jun 7, 2017
1 parent 3f181ea commit 69162924de3600bfe8ae9708a1d6e3f4515ef995
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/openvpn/ntlm.c
View
@@ -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

0 comments on commit 6916292

Please sign in to comment.