avoid compiler/linker warnings

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32483 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-07 11:34:17 +00:00
parent 695c2d279c
commit 96e48988fc
23 changed files with 271 additions and 167 deletions

View file

@ -55,7 +55,7 @@ static NSString *input(char **ptr)
{
if (*tmp == '\'')
{
strcpy(&tmp[-1], tmp);
memmove(&tmp[-1], tmp, strlen(tmp) + 1);
}
else
{

View file

@ -68,7 +68,8 @@ loc_read_file(const char *dir, const char *file)
}
if ((s = strstr(buf, "ocale for")) != NULL)
{
strcpy(country, s+10);
strncpy(country, s + 10, sizeof(country) - 1);
country[sizeof(country) - 1] = '\0';
s = strchr(country, '\n');
if (s)
*s = '\0';
@ -77,10 +78,11 @@ loc_read_file(const char *dir, const char *file)
break;
}
strcpy(locale, file);
strncpy(locale, file, sizeof(locale) - 1);
locale[sizeof(locale) - 1] = '\0';
if (strlen(country) > 0 && strcmp(country, language) != 0)
{
strcat(country, language);
strncat(country, language, sizeof(country) - 1 - strlen(country));
[dict setObject: [NSString stringWithUTF8String: country]
forKey: [NSString stringWithUTF8String: locale]];
}