From e7d20cf352688bf717a01f4e6d9e6f497c2bea4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 20 Sep 2025 19:19:34 +0200 Subject: New upstream version 5.3.1Beta2 --- app/wlib/gtklib/wpref.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'app/wlib/gtklib/wpref.c') diff --git a/app/wlib/gtklib/wpref.c b/app/wlib/gtklib/wpref.c index 356dd95..d83f3e9 100644 --- a/app/wlib/gtklib/wpref.c +++ b/app/wlib/gtklib/wpref.c @@ -107,6 +107,11 @@ const char * wGetAppLibDir( void ) return appLibDir; } + strcpy(appLibDir, XTRKCAD_INSTALL_PREFIX "/" XTRKCAD_SHARE_INSTALL_DIR); + if ((stat( appLibDir, &buf) == 0 ) && S_ISDIR(buf.st_mode)) { + return appLibDir; + } + char * dir1 = "/usr/share/"; char * dir2 = "/usr/local/share/"; char * beta = ""; @@ -265,13 +270,15 @@ wlibSetProfileFilename(char *name) if (name && name[0]) { size_t length; length = snprintf(profileFile, 0, "%s", name); - profileFile = malloc(length + sizeof(NULL)); + length += sizeof(""); + profileFile = malloc(length); snprintf( profileFile, length, "%s", name ); } else { size_t length; length = snprintf(profileFile, 0, "%s/%s.rc", workDir, wConfigName ); - profileFile = malloc(length + sizeof(NULL)); - length = snprintf(profileFile, length+sizeof(NULL), "%s/%s.rc", workDir, wConfigName ); + length += sizeof(""); + profileFile = malloc(length); + length = snprintf(profileFile, length, "%s/%s.rc", workDir, wConfigName ); } } @@ -631,4 +638,4 @@ wPrefFormatLine(const char* section, const char* name, const char* value, char* value = ""; } sprintf(result, "%s.%s: %s", section, name, value); -} \ No newline at end of file +} -- cgit v1.2.3