From fa4a22dde897c0e2a8cc89b7479f0513c9455d37 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Mon, 9 Feb 2009 20:39:14 +0100 Subject: Make it compile on MSVC 2005. --- plutil/plutil.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'plutil') diff --git a/plutil/plutil.c b/plutil/plutil.c index 0431dc6..37d83df 100644 --- a/plutil/plutil.c +++ b/plutil/plutil.c @@ -30,6 +30,11 @@ int main(int argc, char *argv[]) { + FILE *iplist = NULL; + plist_t root_node = NULL; + char *plist_out = NULL; + int size = 0; + char *plist_entire = NULL; struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); Options *options = parse_arguments(argc, argv); @@ -38,19 +43,17 @@ int main(int argc, char *argv[]) return 0; } //read input file - FILE *iplist = fopen(options->in_file, "r"); + iplist = fopen(options->in_file, "rb"); if (!iplist) return 1; stat(options->in_file, filestats); - char *plist_entire = (char *) malloc(sizeof(char) * (filestats->st_size + 1)); + plist_entire = (char *) malloc(sizeof(char) * (filestats->st_size + 1)); fread(plist_entire, sizeof(char), filestats->st_size, iplist); fclose(iplist); //convert one format to another - plist_t root_node = NULL; - char *plist_out = NULL; - int size = 0; + if (memcmp(plist_entire, "bplist00", 8) == 0) { plist_from_bin(plist_entire, filestats->st_size, &root_node); -- cgit v1.1-32-gdbae