diff options
Diffstat (limited to 'src/Common/libzip/zip_file_set_comment.c')
-rw-r--r-- | src/Common/libzip/zip_file_set_comment.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/Common/libzip/zip_file_set_comment.c b/src/Common/libzip/zip_file_set_comment.c index e455fbd2..964486b3 100644 --- a/src/Common/libzip/zip_file_set_comment.c +++ b/src/Common/libzip/zip_file_set_comment.c @@ -19,3 +19,3 @@ written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS @@ -40,5 +40,3 @@ ZIP_EXTERN int -zip_file_set_comment(zip_t *za, zip_uint64_t idx, - const char *comment, zip_uint16_t len, zip_flags_t flags) -{ +zip_file_set_comment(zip_t *za, zip_uint64_t idx, const char *comment, zip_uint16_t len, zip_flags_t flags) { zip_entry_t *e; @@ -61,3 +59,3 @@ zip_file_set_comment(zip_t *za, zip_uint64_t idx, if (len > 0) { - if ((cstr=_zip_string_new((const zip_uint8_t *)comment, len, flags, &za->error)) == NULL) + if ((cstr = _zip_string_new((const zip_uint8_t *)comment, len, flags, &za->error)) == NULL) return -1; @@ -69,3 +67,3 @@ zip_file_set_comment(zip_t *za, zip_uint64_t idx, - e = za->entry+idx; + e = za->entry + idx; @@ -81,13 +79,13 @@ zip_file_set_comment(zip_t *za, zip_uint64_t idx, changed = (cstr != NULL); - + if (changed) { - if (e->changes == NULL) { - if ((e->changes=_zip_dirent_clone(e->orig)) == NULL) { - zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + if (e->changes == NULL) { + if ((e->changes = _zip_dirent_clone(e->orig)) == NULL) { + zip_error_set(&za->error, ZIP_ER_MEMORY, 0); _zip_string_free(cstr); - return -1; - } - } - e->changes->comment = cstr; - e->changes->changed |= ZIP_DIRENT_COMMENT; + return -1; + } + } + e->changes->comment = cstr; + e->changes->changed |= ZIP_DIRENT_COMMENT; } |