diff options
-rw-r--r-- | src/index.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/index.c b/src/index.c index ac6a763..fffa739 100644 --- a/src/index.c +++ b/src/index.c @@ -173,11 +173,13 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv) os = apk_ostream_gzip(os); - memset(&fi, 0, sizeof(fi)); - fi.mode = 0644 | S_IFREG; - fi.name = "DESCRIPTION"; - fi.size = strlen(ictx->description); - apk_tar_write_entry(os, &fi, ictx->description); + if (ictx->description != NULL) { + memset(&fi, 0, sizeof(fi)); + fi.mode = 0644 | S_IFREG; + fi.name = "DESCRIPTION"; + fi.size = strlen(ictx->description); + apk_tar_write_entry(os, &fi, ictx->description); + } memset(&fi, 0, sizeof(fi)); fi.mode = 0644 | S_IFREG; |