summary refs log tree commit diff stats
path: root/src/common/cfgfiles.c
diff options
context:
space:
mode:
authorArnav Singh <arnavion@gmail.com>2012-11-11 19:34:09 -0800
committerArnav Singh <arnavion@gmail.com>2012-11-11 19:34:09 -0800
commited269176919c766ead728e08663715b7f9b1c349 (patch)
treea896a6016ba8dc92c2b365d6332ce7502650610c /src/common/cfgfiles.c
parent49d5234b39aa491747864efba1c2246c6e960b6f (diff)
utf8-everywhere: Fixed some remaining C file I/O API calls to use the glib API.
Diffstat (limited to 'src/common/cfgfiles.c')
-rw-r--r--src/common/cfgfiles.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 8484845e..ffa2e531 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -849,11 +849,9 @@ save_config (void)
 	check_prefs_dir ();
 
 	config = default_file ();
-	new_config = malloc (strlen (config) + 5);
-	strcpy (new_config, config);
-	strcat (new_config, ".new");
+	new_config = g_strdup_printf (config, ".new");
 	
-	fh = open (new_config, OFLAGS | O_TRUNC | O_WRONLY | O_CREAT, 0600);
+	fh = g_open (new_config, OFLAGS | O_TRUNC | O_WRONLY | O_CREAT, 0600);
 	if (fh == -1)
 	{
 		free (new_config);