diff options
Diffstat (limited to 'src/userpref.c')
| -rw-r--r-- | src/userpref.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) | |||
| 188 | char *hostidstr = NULL; | 188 | char *hostidstr = NULL; |
| 189 | plist_get_string_val(hostid, &hostidstr); | 189 | plist_get_string_val(hostid, &hostidstr); |
| 190 | if (hostidstr) { | 190 | if (hostidstr) { |
| 191 | FILE *fd = fopen(cfgfile, "w"); | 191 | FILE *fd = fopen(cfgfile, "wb"); |
| 192 | if (fd) { | 192 | if (fd) { |
| 193 | fprintf(fd, "\n[Global]\nHostID=%s\n", hostidstr); | 193 | fprintf(fd, "\n[Global]\nHostID=%s\n", hostidstr); |
| 194 | fclose(fd); | 194 | fclose(fd); |
| @@ -207,7 +207,7 @@ static int config_write(const char *cfgfile, plist_t dict) | |||
| 207 | return res; | 207 | return res; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | FILE *fd = fopen(cfgfile, "w"); | 210 | FILE *fd = fopen(cfgfile, "wb"); |
| 211 | if (!fd) { | 211 | if (!fd) { |
| 212 | free(xml); | 212 | free(xml); |
| 213 | return res; | 213 | return res; |
| @@ -232,7 +232,7 @@ static int config_read(const char *cfgfile, plist_t *dict) | |||
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | int res = -1; | 234 | int res = -1; |
| 235 | FILE *fd = fopen(cfgfile, "r+"); | 235 | FILE *fd = fopen(cfgfile, "rb"); |
| 236 | if (!fd) { | 236 | if (!fd) { |
| 237 | return -1; | 237 | return -1; |
| 238 | } | 238 | } |
