mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 11:56:21 +00:00
Define POSIX macro to have strdup
98c38dc6d6
sets C99 as standard.
strdup() is not part of C99.
For now set `-D_POSIX_C_SOURCE=200809L` macro to have strdup() in C99.
Using `gnu99` instead would be another option.
We should take more care to use glib functions whenever possible.
Regards https://github.com/profanity-im/profanity/issues/1357
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
|
||||
#define INPBLOCK_DEFAULT 1000
|
||||
|
||||
static char *prefs_loc;
|
||||
static gchar *prefs_loc;
|
||||
static GKeyFile *prefs;
|
||||
gint log_maxsize = 0;
|
||||
|
||||
@@ -209,7 +209,7 @@ prefs_load(char *config_file)
|
||||
if (config_file == NULL) {
|
||||
prefs_loc = files_get_config_path(FILE_PROFRC);
|
||||
} else {
|
||||
prefs_loc = strdup(config_file);
|
||||
prefs_loc = g_strdup(config_file);
|
||||
}
|
||||
|
||||
if (g_file_test(prefs_loc, G_FILE_TEST_EXISTS)) {
|
||||
@@ -236,7 +236,7 @@ prefs_close(void)
|
||||
g_key_file_free(prefs);
|
||||
prefs = NULL;
|
||||
|
||||
free(prefs_loc);
|
||||
g_free(prefs_loc);
|
||||
prefs_loc = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user