diff options
| author | 2011-11-26 15:31:46 +0100 | |
|---|---|---|
| committer | 2012-03-19 01:45:43 +0100 | |
| commit | 055fabdeaa8afcbe905aeb30d5c945f286aecb6a (patch) | |
| tree | edf19d52bb974af429c0f815b0d80b6ac91bae87 /tools/idevicescreenshot.c | |
| parent | d9051baf2e8f4672e6fab3b185a1ec7ce1a8c864 (diff) | |
| download | libimobiledevice-055fabdeaa8afcbe905aeb30d5c945f286aecb6a.tar.gz libimobiledevice-055fabdeaa8afcbe905aeb30d5c945f286aecb6a.tar.bz2 | |
use binary mode for fopen to make it work with win32
Diffstat (limited to 'tools/idevicescreenshot.c')
| -rw-r--r-- | tools/idevicescreenshot.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c index 8567f77..31717dd 100644 --- a/tools/idevicescreenshot.c +++ b/tools/idevicescreenshot.c | |||
| @@ -97,7 +97,7 @@ int main(int argc, char **argv) | |||
| 97 | time_t now = time(NULL); | 97 | time_t now = time(NULL); |
| 98 | strftime(filename, 36, "screenshot-%Y-%m-%d-%H-%M-%S.tiff", gmtime(&now)); | 98 | strftime(filename, 36, "screenshot-%Y-%m-%d-%H-%M-%S.tiff", gmtime(&now)); |
| 99 | if (screenshotr_take_screenshot(shotr, &imgdata, &imgsize) == SCREENSHOTR_E_SUCCESS) { | 99 | if (screenshotr_take_screenshot(shotr, &imgdata, &imgsize) == SCREENSHOTR_E_SUCCESS) { |
| 100 | FILE *f = fopen(filename, "w"); | 100 | FILE *f = fopen(filename, "wb"); |
| 101 | if (f) { | 101 | if (f) { |
| 102 | if (fwrite(imgdata, 1, (size_t)imgsize, f) == (size_t)imgsize) { | 102 | if (fwrite(imgdata, 1, (size_t)imgsize, f) == (size_t)imgsize) { |
| 103 | printf("Screenshot saved to %s\n", filename); | 103 | printf("Screenshot saved to %s\n", filename); |
