diff options
| author | 2013-09-19 05:22:48 +0200 | |
|---|---|---|
| committer | 2013-09-19 05:22:48 +0200 | |
| commit | e53fcd1dd30f7dcd3c496ef25c3dea197e928ce7 (patch) | |
| tree | 28f05a63a086f1e6acfbc2ec20d1ec4c79624f47 | |
| parent | 52b32cdd8c58b42379b367fe5e4f01db730acf3b (diff) | |
| download | libimobiledevice-e53fcd1dd30f7dcd3c496ef25c3dea197e928ce7.tar.gz libimobiledevice-e53fcd1dd30f7dcd3c496ef25c3dea197e928ce7.tar.bz2 | |
utils: make buffer_write_to_filename overwrite instead of append to existing files
| -rw-r--r-- | common/utils.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/common/utils.c b/common/utils.c index 5248c2c..1b207ea 100644 --- a/common/utils.c +++ b/common/utils.c | |||
| @@ -139,9 +139,7 @@ void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t | |||
| 139 | { | 139 | { |
| 140 | FILE *f; | 140 | FILE *f; |
| 141 | 141 | ||
| 142 | f = fopen(filename, "ab"); | 142 | f = fopen(filename, "wb"); |
| 143 | if (!f) | ||
| 144 | f = fopen(filename, "wb"); | ||
| 145 | if (f) { | 143 | if (f) { |
| 146 | fwrite(buffer, sizeof(char), length, f); | 144 | fwrite(buffer, sizeof(char), length, f); |
| 147 | fclose(f); | 145 | fclose(f); |
