diff options
Diffstat (limited to 'test/plist_test.c')
| -rw-r--r-- | test/plist_test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/plist_test.c b/test/plist_test.c index 17be11a..b498e1d 100644 --- a/test/plist_test.c +++ b/test/plist_test.c | |||
| @@ -44,14 +44,16 @@ int main(int argc, char *argv[]) | |||
| 44 | uint32_t size_out = 0; | 44 | uint32_t size_out = 0; |
| 45 | uint32_t size_out2 = 0; | 45 | uint32_t size_out2 = 0; |
| 46 | char *file_in = NULL; | 46 | char *file_in = NULL; |
| 47 | char *file_out = NULL; | ||
| 47 | struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); | 48 | struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); |
| 48 | if (argc!= 2) | 49 | if (argc != 3) |
| 49 | { | 50 | { |
| 50 | printf("Wrong input\n"); | 51 | printf("Wrong input\n"); |
| 51 | return 1; | 52 | return 1; |
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | file_in = argv[1]; | 55 | file_in = argv[1]; |
| 56 | file_out = argv[2]; | ||
| 55 | //read input file | 57 | //read input file |
| 56 | iplist = fopen(file_in, "rb"); | 58 | iplist = fopen(file_in, "rb"); |
| 57 | 59 | ||
| @@ -108,8 +110,6 @@ int main(int argc, char *argv[]) | |||
| 108 | if (plist_xml2) | 110 | if (plist_xml2) |
| 109 | { | 111 | { |
| 110 | FILE *oplist = NULL; | 112 | FILE *oplist = NULL; |
| 111 | char file_out[512]; | ||
| 112 | sprintf(file_out, "%s.out", file_in); | ||
| 113 | oplist = fopen(file_out, "wb"); | 113 | oplist = fopen(file_out, "wb"); |
| 114 | fwrite(plist_xml2, size_out2, sizeof(char), oplist); | 114 | fwrite(plist_xml2, size_out2, sizeof(char), oplist); |
| 115 | fclose(oplist); | 115 | fclose(oplist); |
