* Currently, an unlimited number of foreign displays can log in.
*/
- if (user) strncpy(u->ut_user, user, sizeof(u->ut_user));
+ if (user) snprintf(u->ut_user, sizeof(u->ut_user), "%s", user);
if (line) {
#ifdef _AIX
/*
char *type;
XrmValue value;
char *string, *new_string;
+ char empty[] = "";
char str_buf[50];
int len;
}
else
{
- string = default_value;
- len = (string == NULL ? 0 : strlen (string));
+ if(default_value) {
+ string = default_value;
+ len = strlen (string);
+ } else {
+ string = empty;
+ len = 0;
+ }
}
Debug ("%s/%s value %*.*s\n", name, class, len, len, string);
Debug("LoadAltDtsResources- cant access %s.\n", resources);
Debug("\t %s. Falling back to C.\n", strerror(errno));
- if (resources)
- {
- free (resources);
- resources = NULL;
- }
+ free (resources);
+ resources = NULL;
resources = _ExpandLang(dirname[j], "C");
if (access (resources, R_OK) != 0)
language = d->language;
#endif /* ENABLE_DYNAMIC_LANGLIST */
- if ( d->language && strlen(d->language) > 0 )
+ if (env && d->language && strlen(d->language) > 0 )
env = setLang(d, env, language);
}
langlist = languageList;
#endif /* ENABLE_DYNAMIC_LANGLIST */
- if (d->language && strlen(d->language) > 0)
+ if (env && d->language && strlen(d->language) > 0)
env = setLang(d, env, langlist);
#if 0 /* setting LC_ALL can cause undesirable side effects -- bf@hp */
*/
- if ( strlen(greetInfo.labelString) == 0 ||
+ if ( !greetInfo.labelString ||
+ strlen(greetInfo.labelString) == 0 ||
strcmp(greetInfo.labelString, "None") == 0 ||
strcmp(greetInfo.labelString, "none") == 0 )