diff options
author | Alberto <alberto.ruiz@codethink.co.uk> | 2011-09-30 17:14:56 +0100 |
---|---|---|
committer | Alberto <alberto.ruiz@codethink.co.uk> | 2011-09-30 17:14:56 +0100 |
commit | b9fc8b88b8d72e42cabcf1bafba4855a3cf73c3e (patch) | |
tree | 87fe96d5c18bb4b998109ce23fe52f5c545069da | |
parent | aa96d47694f5523b827c7e79a9773baa316686f3 (diff) | |
download | tbdiff-b9fc8b88b8d72e42cabcf1bafba4855a3cf73c3e.tar.gz |
Fixed some style issues
-rw-r--r-- | libtbd_apply.c | 32 | ||||
-rw-r--r-- | libtbd_create.c | 78 | ||||
-rw-r--r-- | libtbd_stat.c | 55 | ||||
-rw-r--r-- | libtbd_stat.h | 18 | ||||
-rw-r--r-- | tbdiff.h | 4 | ||||
-rw-r--r-- | tbdiff_create.c | 4 |
6 files changed, 96 insertions, 95 deletions
diff --git a/libtbd_apply.c b/libtbd_apply.c index 06c78b9..a50e72c 100644 --- a/libtbd_apply.c +++ b/libtbd_apply.c @@ -48,7 +48,7 @@ tbd_apply_fread_string(FILE *stream) } static int -tbd_apply_identify(FILE* stream) +tbd_apply_identify(FILE *stream) { uint8_t cmd; if(fread(&cmd, 1, 1, stream) != 1) @@ -69,7 +69,7 @@ tbd_apply_identify(FILE* stream) } static int -tbd_apply_cmd_dir_create(FILE* stream) +tbd_apply_cmd_dir_create(FILE *stream) { uint16_t dlen; if(fread(&dlen, sizeof(uint16_t), 1, stream) != 1) @@ -113,7 +113,7 @@ tbd_apply_cmd_dir_create(FILE* stream) static int tbd_apply_cmd_dir_enter(FILE *stream, - uintptr_t *depth) + uintptr_t *depth) { uint16_t dlen; if(fread(&dlen, 2, 1, stream) != 1) @@ -135,7 +135,7 @@ tbd_apply_cmd_dir_enter(FILE *stream, static int tbd_apply_cmd_dir_leave(FILE *stream, - uintptr_t *depth) + uintptr_t *depth) { uint8_t count; if(fread(&count, 1, 1, stream) != 1) @@ -158,7 +158,7 @@ tbd_apply_cmd_dir_leave(FILE *stream, } static int -tbd_apply_cmd_file_create(FILE* stream) +tbd_apply_cmd_file_create(FILE *stream) { uint16_t flen; if(fread(&flen, 2, 1, stream) != 1) @@ -185,7 +185,7 @@ tbd_apply_cmd_file_create(FILE* stream) fprintf(stderr, "cmd_file_create %s:%"PRId32"\n", fname, fsize); - FILE* fp = fopen(fname, "rb"); + FILE *fp = fopen(fname, "rb"); if(fp != NULL) { fclose(fp); otap_error(TBD_ERROR_FILE_ALREADY_EXISTS); @@ -221,7 +221,7 @@ tbd_apply_cmd_file_create(FILE* stream) } static int -tbd_apply_cmd_file_delta(FILE* stream) +tbd_apply_cmd_file_delta(FILE *stream) { uint16_t mdata_mask; uint32_t mtime; @@ -250,14 +250,14 @@ tbd_apply_cmd_file_delta(FILE* stream) fread(&mode, sizeof(uint32_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_READ_STREAM); - FILE* op = fopen(fname, "rb"); + FILE *op = fopen(fname, "rb"); if(op == NULL) otap_error(TBD_ERROR_UNABLE_TO_OPEN_FILE_FOR_READING); if(remove(fname) != 0) { fclose(op); otap_error(TBD_ERROR_UNABLE_TO_REMOVE_FILE); } - FILE* np = fopen(fname, "wb"); + FILE *np = fopen(fname, "wb"); if(np == NULL) { fclose(op); otap_error(TBD_ERROR_UNABLE_TO_OPEN_FILE_FOR_WRITING); @@ -324,9 +324,9 @@ tbd_apply_cmd_file_delta(FILE* stream) } static int -_tbd_apply_cmd_entity_delete(const char* name) +tbd_apply_cmd_entity_delete_for_name(const char *name) { - DIR* dp = opendir(name); + DIR *dp = opendir(name); if(dp == NULL) { if(remove(name) != 0) otap_error(TBD_ERROR_UNABLE_TO_REMOVE_FILE); @@ -339,14 +339,14 @@ _tbd_apply_cmd_entity_delete(const char* name) otap_error(TBD_ERROR_UNABLE_TO_CHANGE_DIR); } - struct dirent* entry; + struct dirent *entry; while((entry = readdir(dp)) != NULL) { if((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0)) continue; int err; - if((err = _tbd_apply_cmd_entity_delete(entry->d_name)) != 0) { + if((err = tbd_apply_cmd_entity_delete_for_name(entry->d_name)) != 0) { closedir(dp); if(chdir("..") != 0) @@ -365,7 +365,7 @@ _tbd_apply_cmd_entity_delete(const char* name) } static int -tbd_apply_cmd_entity_delete(FILE* stream) +tbd_apply_cmd_entity_delete(FILE *stream) { uint16_t elen; if(fread(&elen, 2, 1, stream) != 1) @@ -379,7 +379,7 @@ tbd_apply_cmd_entity_delete(FILE* stream) if((strchr(ename, '/') != NULL) || (strcmp(ename, "..") == 0)) otap_error(TBD_ERROR_INVALID_PARAMETER); - return _tbd_apply_cmd_entity_delete(ename); + return tbd_apply_cmd_entity_delete_for_name(ename); } static int @@ -541,7 +541,7 @@ tbd_apply_cmd_file_mdata_update(FILE *stream) } int -otap_apply(FILE* stream) +otap_apply(FILE *stream) { if(stream == NULL) otap_error(TBD_ERROR_NULL_POINTER); diff --git a/libtbd_create.c b/libtbd_create.c index 311e3c7..5f72baa 100644 --- a/libtbd_create.c +++ b/libtbd_create.c @@ -33,7 +33,7 @@ static int tbd_create_fwrite_cmd(FILE *stream, - uint8_t cmd) + uint8_t cmd) { if(fwrite(&cmd, 1, 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -42,7 +42,7 @@ tbd_create_fwrite_cmd(FILE *stream, static int tbd_create_fwrite_string(FILE *stream, - const char *string) + const char *string) { uint16_t slen = strlen(string); if((fwrite(&slen, 2, 1, stream) != 1) @@ -53,7 +53,7 @@ tbd_create_fwrite_string(FILE *stream, static int tbd_create_fwrite_mdata_mask(FILE *stream, - uint16_t mask) + uint16_t mask) { if(fwrite(&mask, sizeof(uint16_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -62,7 +62,7 @@ tbd_create_fwrite_mdata_mask(FILE *stream, static int tbd_create_fwrite_mtime(FILE *stream, - uint32_t mtime) + uint32_t mtime) { if(fwrite(&mtime, sizeof(uint32_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -71,7 +71,7 @@ tbd_create_fwrite_mtime(FILE *stream, static int tbd_create_fwrite_mode(FILE *stream, - uint32_t mode) + uint32_t mode) { if(fwrite(&mode, sizeof(uint32_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -80,7 +80,7 @@ tbd_create_fwrite_mode(FILE *stream, static int tbd_create_fwrite_gid(FILE *stream, - gid_t gid) + gid_t gid) { if(fwrite(&gid, sizeof(gid_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -89,7 +89,7 @@ tbd_create_fwrite_gid(FILE *stream, static int tbd_create_fwrite_uid(FILE *stream, - uid_t uid) + uid_t uid) { if(fwrite(&uid, sizeof(uid_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -98,7 +98,7 @@ tbd_create_fwrite_uid(FILE *stream, static int tbd_create_fwrite_dev(FILE *stream, - uint32_t dev) + uint32_t dev) { if(fwrite(&dev, sizeof(uint32_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); @@ -106,7 +106,7 @@ tbd_create_fwrite_dev(FILE *stream, } static int -tbd_create_cmd_ident(FILE* stream) +tbd_create_cmd_ident(FILE *stream) { int err; @@ -125,7 +125,7 @@ tbd_create_cmd_update(FILE *stream) static int tbd_create_cmd_file_create(FILE *stream, - tbd_stat_t *f) + tbd_stat_t *f) { int err; if((err = tbd_create_fwrite_cmd(stream, TBD_CMD_FILE_CREATE)) != 0 || @@ -140,7 +140,7 @@ tbd_create_cmd_file_create(FILE *stream, if(fwrite(&size, sizeof(uint32_t), 1, stream) != 1) otap_error(TBD_ERROR_UNABLE_TO_WRITE_STREAM); - FILE* fp = tbd_stat_fopen(f, "rb"); + FILE *fp = tbd_stat_fopen(f, "rb"); if(fp == NULL) otap_error(TBD_ERROR_UNABLE_TO_OPEN_FILE_FOR_READING); @@ -160,7 +160,7 @@ tbd_create_cmd_file_create(FILE *stream, static uint16_t tbd_metadata_mask(tbd_stat_t *a, - tbd_stat_t *b) + tbd_stat_t *b) { uint16_t metadata_mask = TBD_METADATA_NONE; @@ -179,8 +179,8 @@ tbd_metadata_mask(tbd_stat_t *a, static int tbd_create_cmd_file_metadata_update(FILE *stream, - tbd_stat_t *a, - tbd_stat_t *b) + tbd_stat_t *a, + tbd_stat_t *b) { int err; uint16_t metadata_mask = tbd_metadata_mask(a, b); @@ -201,13 +201,13 @@ tbd_create_cmd_file_metadata_update(FILE *stream, static int tbd_create_cmd_file_delta(FILE *stream, - tbd_stat_t *a, - tbd_stat_t *b) + tbd_stat_t *a, + tbd_stat_t *b) { - FILE* fpa = tbd_stat_fopen(a, "rb"); + FILE *fpa = tbd_stat_fopen(a, "rb"); if(fpa == NULL) otap_error(TBD_ERROR_UNABLE_TO_OPEN_FILE_FOR_READING); - FILE* fpb = tbd_stat_fopen(b, "rb"); + FILE *fpb = tbd_stat_fopen(b, "rb"); if(fpb == NULL) { fclose(fpa); otap_error(TBD_ERROR_UNABLE_TO_OPEN_FILE_FOR_READING); @@ -346,7 +346,7 @@ tbd_create_cmd_file_delta(FILE *stream, static int tbd_create_cmd_dir_create(FILE *stream, - tbd_stat_t *d) + tbd_stat_t *d) { int err; @@ -362,7 +362,7 @@ tbd_create_cmd_dir_create(FILE *stream, static int tbd_create_cmd_dir_enter(FILE *stream, - const char *name) + const char *name) { int err; if((err = tbd_create_fwrite_cmd(stream, TBD_CMD_DIR_ENTER)) != 0) @@ -372,7 +372,7 @@ tbd_create_cmd_dir_enter(FILE *stream, static int tbd_create_cmd_dir_leave(FILE *stream, - uintptr_t count) + uintptr_t count) { if(count == 0) return 0; @@ -397,7 +397,7 @@ tbd_create_cmd_dir_leave(FILE *stream, static int tbd_create_cmd_entity_delete(FILE *stream, - const char *name) + const char *name) { int err; if((err = tbd_create_fwrite_cmd(stream, TBD_CMD_ENTITY_DELETE)) != 0) @@ -407,8 +407,8 @@ tbd_create_cmd_entity_delete(FILE *stream, static int tbd_create_cmd_dir_delta(FILE *stream, - tbd_stat_t *a, - tbd_stat_t *b) + tbd_stat_t *a, + tbd_stat_t *b) { int err; uint16_t metadata_mask = tbd_metadata_mask(a, b); @@ -429,7 +429,7 @@ tbd_create_cmd_dir_delta(FILE *stream, static int tbd_create_cmd_symlink_create(FILE *stream, - tbd_stat_t *symlink) + tbd_stat_t *symlink) { int err; char path[PATH_BUFFER_LENGTH]; @@ -453,8 +453,8 @@ tbd_create_cmd_symlink_create(FILE *stream, static int tbd_create_cmd_symlink_delta(FILE *stream, - tbd_stat_t *a, - tbd_stat_t *b) + tbd_stat_t *a, + tbd_stat_t *b) { int err; char path_a[PATH_BUFFER_LENGTH]; @@ -490,7 +490,7 @@ tbd_create_cmd_symlink_delta(FILE *stream, static int tbd_create_cmd_special_create(FILE *stream, - tbd_stat_t *nod) + tbd_stat_t *nod) { int err; @@ -506,8 +506,8 @@ tbd_create_cmd_special_create(FILE *stream, static int tbd_create_cmd_special_delta(FILE *stream, - tbd_stat_t *a, - tbd_stat_t *b) + tbd_stat_t *a, + tbd_stat_t *b) { uint16_t metadata_mask = TBD_METADATA_NONE; @@ -535,7 +535,7 @@ tbd_create_cmd_special_delta(FILE *stream, static int tbd_create_dir(FILE *stream, - tbd_stat_t *d) + tbd_stat_t *d) { int err; if(((err =tbd_create_cmd_dir_create(stream, d)) != 0) || @@ -544,7 +544,7 @@ tbd_create_dir(FILE *stream, uintptr_t i; for(i = 0; i < d->size; i++) { - tbd_stat_t* f = tbd_stat_entry(d, i); + tbd_stat_t *f = tbd_stat_entry(d, i); if(f == NULL) otap_error(TBD_ERROR_UNABLE_TO_STAT_FILE); @@ -580,9 +580,9 @@ tbd_create_dir(FILE *stream, static int tbd_create(FILE *stream, - tbd_stat_t *a, - tbd_stat_t *b, - bool top) + tbd_stat_t *a, + tbd_stat_t *b, + bool top) { if((a == NULL) && (b == NULL)) otap_error(TBD_ERROR_NULL_POINTER); @@ -646,10 +646,10 @@ tbd_create(FILE *stream, // Handle changes/additions. uintptr_t i; for(i = 0; i < b->size; i++) { - tbd_stat_t* _b = tbd_stat_entry(b, i); + tbd_stat_t *_b = tbd_stat_entry(b, i); if(_b == NULL) otap_error(TBD_ERROR_UNABLE_TO_STAT_FILE); - tbd_stat_t* _a = tbd_stat_entry_find(a, _b->name); + tbd_stat_t *_a = tbd_stat_entry_find(a, _b->name); err = tbd_create(stream, _a, _b, false); tbd_stat_free(_a); tbd_stat_free(_b); @@ -659,10 +659,10 @@ tbd_create(FILE *stream, // Handle deletions. for(i = 0; i < a->size; i++) { - tbd_stat_t* _a = tbd_stat_entry(a, i); + tbd_stat_t *_a = tbd_stat_entry(a, i); if(_a == NULL) otap_error(TBD_ERROR_UNABLE_TO_STAT_FILE); - tbd_stat_t* _b = tbd_stat_entry_find(b, _a->name); + tbd_stat_t *_b = tbd_stat_entry_find(b, _a->name); fprintf(stderr, "file delete %s\n", _a->name); err = (_b != NULL ? 0 : tbd_create_cmd_entity_delete(stream, _a->name)); tbd_stat_free(_b); diff --git a/libtbd_stat.c b/libtbd_stat.c index c4cc100..905720b 100644 --- a/libtbd_stat.c +++ b/libtbd_stat.c @@ -40,7 +40,7 @@ __tbd_stat(const char *name, return NULL; size_t nlen = strlen(name); - tbd_stat_t* ret = (tbd_stat_t*)malloc(sizeof(tbd_stat_t) + (nlen + 1)); + tbd_stat_t *ret = (tbd_stat_t*)malloc(sizeof(tbd_stat_t) + (nlen + 1)); if(ret == NULL) return NULL; @@ -53,7 +53,7 @@ __tbd_stat(const char *name, ret->size = info.st_size; } else if(S_ISDIR(info.st_mode)) { ret->type = TBD_STAT_TYPE_DIR; - DIR* dp = opendir(path); + DIR *dp = opendir(path); if(dp == NULL) { free(ret); @@ -61,7 +61,7 @@ __tbd_stat(const char *name, } ret->size = 0; - struct dirent* ds; + struct dirent *ds; for(ds = readdir(dp); ds != NULL; ds = readdir(dp)) { if((strcmp(ds->d_name, ".") == 0) || (strcmp(ds->d_name, "..") == 0)) @@ -100,26 +100,26 @@ __tbd_stat(const char *name, } tbd_stat_t* -tbd_stat(const char* path) +tbd_stat(const char *path) { - tbd_stat_t* ret = __tbd_stat(path, path); + tbd_stat_t *ret = __tbd_stat(path, path); return ret; } void -tbd_stat_free(tbd_stat_t* file) +tbd_stat_free(tbd_stat_t *file) { free(file); } void -tbd_stat_print(tbd_stat_t* file) +tbd_stat_print(tbd_stat_t *file) { (void)file; } tbd_stat_t* -tbd_stat_entry(tbd_stat_t* file, uint32_t entry) +tbd_stat_entry(tbd_stat_t *file, uint32_t entry) { if((file == NULL) || (file->type != TBD_STAT_TYPE_DIR) @@ -127,14 +127,14 @@ tbd_stat_entry(tbd_stat_t* file, uint32_t entry) return NULL; char *path = tbd_stat_path(file); - DIR* dp = opendir(path); + DIR *dp = opendir(path); free (path); if(dp == NULL) return NULL; uintptr_t i; - struct dirent* ds; + struct dirent *ds; for(i = 0; i <= entry; i++) { ds = readdir(dp); if(ds == NULL) { @@ -148,11 +148,11 @@ tbd_stat_entry(tbd_stat_t* file, uint32_t entry) } closedir (dp); - char* spath = tbd_stat_subpath(file, ds->d_name); + char *spath = tbd_stat_subpath(file, ds->d_name); if(spath == NULL) return NULL; - tbd_stat_t* ret = __tbd_stat(ds->d_name, (const char*)spath); + tbd_stat_t *ret = __tbd_stat(ds->d_name, (const char*)spath); free(spath); @@ -164,28 +164,29 @@ tbd_stat_entry(tbd_stat_t* file, uint32_t entry) } tbd_stat_t* -tbd_stat_entry_find(tbd_stat_t* file, const char* name) +tbd_stat_entry_find(tbd_stat_t *file, + const char *name) { if((file == NULL) || (file->type != TBD_STAT_TYPE_DIR)) return NULL; char *path = tbd_stat_path (file); - DIR* dp = opendir(path); + DIR *dp = opendir(path); free (path); if(dp == NULL) return NULL; - struct dirent* ds; + struct dirent *ds; for(ds = readdir(dp); ds != NULL; ds = readdir(dp)) { if(strcmp(ds->d_name, name) == 0) { closedir (dp); - char* spath = tbd_stat_subpath(file, ds->d_name); + char *spath = tbd_stat_subpath(file, ds->d_name); if(spath == NULL) return NULL; - tbd_stat_t* ret = __tbd_stat(ds->d_name, (const char *)spath); + tbd_stat_t *ret = __tbd_stat(ds->d_name, (const char *)spath); free(spath); ret->parent = file; @@ -199,7 +200,7 @@ tbd_stat_entry_find(tbd_stat_t* file, const char* name) char* tbd_stat_subpath(tbd_stat_t *file, - const char *entry) + const char *entry) { if(file == NULL) return NULL; @@ -207,7 +208,7 @@ tbd_stat_subpath(tbd_stat_t *file, size_t elen = ((entry == NULL) ? 0 : (strlen(entry) + 1)); size_t plen; - tbd_stat_t* root; + tbd_stat_t *root; for(root = file, plen = 0; root != NULL; plen += (strlen(root->name) + 1), @@ -215,10 +216,10 @@ tbd_stat_subpath(tbd_stat_t *file, plen += elen; - char* path = (char*)malloc(plen); + char *path = (char*)malloc(plen); if(path == NULL) return NULL; - char* ptr = &path[plen]; + char *ptr = &path[plen]; if(entry != NULL) { ptr = (char*)((uintptr_t)ptr - elen); @@ -237,15 +238,15 @@ tbd_stat_subpath(tbd_stat_t *file, } char* -tbd_stat_path(tbd_stat_t* file) +tbd_stat_path(tbd_stat_t *file) { return tbd_stat_subpath(file, NULL); } int -tbd_stat_open(tbd_stat_t* file, int flags) +tbd_stat_open(tbd_stat_t *file, int flags) { - char* path = tbd_stat_path(file); + char *path = tbd_stat_path(file); if(path == NULL) return -1; int fd = open(path, flags); @@ -255,12 +256,12 @@ tbd_stat_open(tbd_stat_t* file, int flags) FILE* tbd_stat_fopen(tbd_stat_t *file, - const char *mode) + const char *mode) { - char* path = tbd_stat_path(file); + char *path = tbd_stat_path(file); if(path == NULL) return NULL; - FILE* fp = fopen(path, mode); + FILE *fp = fopen(path, mode); free(path); return fp; } diff --git a/libtbd_stat.h b/libtbd_stat.h index e075f44..f375ab1 100644 --- a/libtbd_stat.h +++ b/libtbd_stat.h @@ -45,14 +45,14 @@ typedef struct { uint32_t rdev; } tbd_stat_t; -extern tbd_stat_t* tbd_stat(const char* path); -extern void tbd_stat_free(tbd_stat_t* file); -extern void tbd_stat_print(tbd_stat_t* file); -extern tbd_stat_t* tbd_stat_entry(tbd_stat_t* file, uint32_t entry); -extern tbd_stat_t* tbd_stat_entry_find(tbd_stat_t* file, const char* name); -extern char* tbd_stat_subpath(tbd_stat_t* file, const char* entry); -extern char* tbd_stat_path(tbd_stat_t* file); -extern int tbd_stat_open(tbd_stat_t* file, int flags); -extern FILE* tbd_stat_fopen(tbd_stat_t* file, const char* mode); +extern tbd_stat_t* tbd_stat(const char *path); +extern void tbd_stat_free(tbd_stat_t *file); +extern void tbd_stat_print(tbd_stat_t *file); +extern tbd_stat_t* tbd_stat_entry(tbd_stat_t *file, uint32_t entry); +extern tbd_stat_t* tbd_stat_entry_find(tbd_stat_t *file, const char *name); +extern char* tbd_stat_subpath(tbd_stat_t *file, const char *entry); +extern char* tbd_stat_path(tbd_stat_t *file); +extern int tbd_stat_open(tbd_stat_t *file, int flags); +extern FILE* tbd_stat_fopen(tbd_stat_t *file, const char *mode); #endif /* __LIBTBD_STAT_H__ */ @@ -80,7 +80,7 @@ typedef enum { #define otap_error(e) { if(e != 0) fprintf(stderr, "OTAP error '%s' in function '%s' at line %d of file '%s'.\n", #e, __FUNCTION__, __LINE__, __FILE__); return e; } #endif -extern int otap_apply(FILE* stream); -extern int otap_create(FILE* stream, tbd_stat_t* a, tbd_stat_t* b); +extern int otap_apply(FILE *stream); +extern int otap_create(FILE *stream, tbd_stat_t *a, tbd_stat_t *b); #endif /* __TBDIFF_H__ */ diff --git a/tbdiff_create.c b/tbdiff_create.c index b8ded2e..b8e55e5 100644 --- a/tbdiff_create.c +++ b/tbdiff_create.c @@ -39,7 +39,7 @@ main(int argc, if(getcwd(cwd_buff, cwd_size) == NULL) return EXIT_FAILURE; - tbd_stat_t* tstat[2]; + tbd_stat_t *tstat[2]; tstat[0] = tbd_stat(argv[2]); if(tstat[0] == NULL) { @@ -63,7 +63,7 @@ main(int argc, return EXIT_FAILURE; } - FILE* fp = fopen(argv[1], "wb"); + FILE *fp = fopen(argv[1], "wb"); if(fp == NULL) { fprintf(stderr, "ERROR: Unable to open patch for writing.\n"); return EXIT_FAILURE; |