Merge branch 'master' into issue-428

Conflicts:
	version.txt
This commit is contained in:
Geoff McLane 2016-08-09 00:45:46 +02:00
commit 80e57b23bf
2 changed files with 13 additions and 13 deletions

View file

@ -601,7 +601,6 @@ tmbstr tidyNormalizedLocaleName( ctmbstr locale )
uint i; uint i;
uint len; uint len;
static char result[6] = "xx_yy"; static char result[6] = "xx_yy";
char character[1];
tmbstr search = strdup(locale); tmbstr search = strdup(locale);
search = TY_(tmbstrtolower)(search); search = TY_(tmbstrtolower)(search);
@ -622,27 +621,28 @@ tmbstr tidyNormalizedLocaleName( ctmbstr locale )
junk language that doesn't exist and won't be set. */ junk language that doesn't exist and won't be set. */
len = strlen( search ); len = strlen( search );
len = len <= 5 ? len : 5; len = ( len <= 5 ? len : 5 );
for ( i = 0; i <= len; i++ ) for ( i = 0; i < len; i++ )
{ {
if ( i == 2 ) if ( i == 2 )
{ {
/* Either terminate the string or ensure there's an underscore */ /* Either terminate the string or ensure there's an underscore */
if (strlen( search) >= 5) if (len == 5) {
character[0] = '_'; result[i] = '_';
else }
character[0] = '\0'; else {
strncpy( result + i, character, 1 ); result[i] = '\0';
break; /* no need to copy after null */
}
} }
else else
{ {
strncpy( result + i, search + i, 1); result[i] = tolower( search[i] );
result[i] = tolower( result[i] );
} }
} }
if ( search ) free( search ); free( search );
return result; return result;
} }

View file

@ -1,2 +1,2 @@
5.3.8-Issue-428 5.3.9-Issue-428
2016.07.29 2016.08.04