From 059de1b310095402597e51c5ac7078ed66ebfbd9 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 5 Oct 2011 22:22:14 +0200 Subject: Fixed userprefs read/write on win32 --- src/userpref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/userpref.c') diff --git a/src/userpref.c b/src/userpref.c index 8d2ebf2..4c72981 100644 --- a/src/userpref.c +++ b/src/userpref.c @@ -188,7 +188,7 @@ static int config_write(const char *cfgfile, plist_t dict) char *hostidstr = NULL; plist_get_string_val(hostid, &hostidstr); if (hostidstr) { - FILE *fd = fopen(cfgfile, "w"); + FILE *fd = fopen(cfgfile, "wb"); if (fd) { fprintf(fd, "\n[Global]\nHostID=%s\n", hostidstr); fclose(fd); @@ -207,7 +207,7 @@ static int config_write(const char *cfgfile, plist_t dict) return res; } - FILE *fd = fopen(cfgfile, "w"); + FILE *fd = fopen(cfgfile, "wb"); if (!fd) { free(xml); return res; @@ -232,7 +232,7 @@ static int config_read(const char *cfgfile, plist_t *dict) } int res = -1; - FILE *fd = fopen(cfgfile, "r+"); + FILE *fd = fopen(cfgfile, "rb"); if (!fd) { return -1; } -- cgit v1.1-32-gdbae