String API: BLI_ascii_strtolower/upper now check NULL terminator

This wasn't needed before now, but since recent change to bUnit_ReplaceString,
it uses in a context where NULL terminator is expected - best add.
(spotted by Sergey)
This commit is contained in:
Campbell Barton 2013-12-25 01:20:46 +11:00
parent e1b322b250
commit 7f4533fa49
1 changed files with 2 additions and 2 deletions

View File

@ -582,7 +582,7 @@ void BLI_ascii_strtolower(char *str, const size_t len)
{
size_t i;
for (i = 0; i < len; i++)
for (i = 0; (i < len) && str[i]; i++)
if (str[i] >= 'A' && str[i] <= 'Z')
str[i] += 'a' - 'A';
}
@ -591,7 +591,7 @@ void BLI_ascii_strtoupper(char *str, const size_t len)
{
size_t i;
for (i = 0; i < len; i++)
for (i = 0; (i < len) && str[i]; i++)
if (str[i] >= 'a' && str[i] <= 'z')
str[i] -= 'a' - 'A';
}