Improve previous. --HG-- branch : HEAD
diff --git a/lib/zip_replace.c b/lib/zip_replace.c index 3f96e5e..4e2f53d 100644 --- a/lib/zip_replace.c +++ b/lib/zip_replace.c
@@ -65,6 +65,7 @@ return -1; } + zip_uint64_t za_nentry_prev = za->nentry; if (idx == ZIP_UINT64_MAX) { if (_zip_entry_new(za) == NULL) return -1; @@ -73,7 +74,7 @@ } if (name && _zip_set_name(za, idx, name) != 0) { - za->nentry--; + za->nentry = za_nentry_prev; return -1; }