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 @@
30 30
31int main(int argc, char *argv[]) 31int main(int argc, char *argv[])
32{ 32{
33 FILE *iplist = NULL;
34 plist_t root_node = NULL;
35 char *plist_out = NULL;
36 int size = 0;
37 char *plist_entire = NULL;
33 struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); 38 struct stat *filestats = (struct stat *) malloc(sizeof(struct stat));
34 Options *options = parse_arguments(argc, argv); 39 Options *options = parse_arguments(argc, argv);
35 40
@@ -38,19 +43,17 @@ int main(int argc, char *argv[])
38 return 0; 43 return 0;
39 } 44 }
40 //read input file 45 //read input file
41 FILE *iplist = fopen(options->in_file, "r"); 46 iplist = fopen(options->in_file, "rb");
42 if (!iplist) 47 if (!iplist)
43 return 1; 48 return 1;
44 stat(options->in_file, filestats); 49 stat(options->in_file, filestats);
45 char *plist_entire = (char *) malloc(sizeof(char) * (filestats->st_size + 1)); 50 plist_entire = (char *) malloc(sizeof(char) * (filestats->st_size + 1));
46 fread(plist_entire, sizeof(char), filestats->st_size, iplist); 51 fread(plist_entire, sizeof(char), filestats->st_size, iplist);
47 fclose(iplist); 52 fclose(iplist);
48 53
49 54
50 //convert one format to another 55 //convert one format to another
51 plist_t root_node = NULL; 56
52 char *plist_out = NULL;
53 int size = 0;
54 57
55 if (memcmp(plist_entire, "bplist00", 8) == 0) { 58 if (memcmp(plist_entire, "bplist00", 8) == 0) {
56 plist_from_bin(plist_entire, filestats->st_size, &root_node); 59 plist_from_bin(plist_entire, filestats->st_size, &root_node);