Trying to fix $HOME bug

This commit is contained in:
Nikolai Rinas
2017-03-14 22:19:00 -07:00
parent 3f7a633742
commit e4622a710b
2 changed files with 5 additions and 1 deletions

Binary file not shown.

View File

@@ -89,7 +89,11 @@ int buttonDefined(int val) {
int getConfigFile() {
int rc=1; // Default nothing found
// Determine home dir
strcat(strcpy(iniFile, getenv("HOME")), myConfFile);
char *homeEnv = getenv("HOME");
int strLength = strlen(homeEnv);
if (strLength > 0 ) {
strcat(strncpy(iniFile, homeEnv, strLength), myConfFile);
}
// Look for personal file
if( access( iniFile, R_OK ) != -1 ) {