summaryrefslogtreecommitdiffstats
path: root/plutil/plutil.c
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2009-02-09 20:39:14 +0100
committerGravatar Jonathan Beck2009-02-09 21:02:56 +0100
commitfa4a22dde897c0e2a8cc89b7479f0513c9455d37 (patch)
tree877b0140a133fb34c821ff70bde1a4a8c6ef5ab1 /plutil/plutil.c
parentff1fa73f33e9223e69cbb71e70b084e3482dce3f (diff)
downloadlibplist-fa4a22dde897c0e2a8cc89b7479f0513c9455d37.tar.gz
libplist-fa4a22dde897c0e2a8cc89b7479f0513c9455d37.tar.bz2
Make it compile on MSVC 2005.
Diffstat (limited to 'plutil/plutil.c')
-rw-r--r--plutil/plutil.c13
1 files changed, 8 insertions, 5 deletions
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);