diff options
| author | 2011-10-05 22:22:14 +0200 | |
|---|---|---|
| committer | 2012-03-19 01:45:09 +0100 | |
| commit | 059de1b310095402597e51c5ac7078ed66ebfbd9 (patch) | |
| tree | 8de9fd47f1028a66cf8d1a398ff10cb61d0d7d53 /src/userpref.c | |
| parent | 10ad0c14e888291228c2f0c464e32e9c706c824e (diff) | |
| download | libimobiledevice-059de1b310095402597e51c5ac7078ed66ebfbd9.tar.gz libimobiledevice-059de1b310095402597e51c5ac7078ed66ebfbd9.tar.bz2 | |
Fixed userprefs read/write on win32
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 | } |
