diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-19 09:55:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-19 09:55:15 +0000 |
commit | ec68b6822b75ae3e803c46426e97823f0f6a9d55 (patch) | |
tree | a2a1f43663215b0edbe7d05d15e53a9aaa95b5a8 /src | |
parent | 9e58b2dd55f0baf6099836695066c58bb04ba9f8 (diff) | |
download | apk-tools-ec68b6822b75ae3e803c46426e97823f0f6a9d55.tar.gz apk-tools-ec68b6822b75ae3e803c46426e97823f0f6a9d55.tar.bz2 apk-tools-ec68b6822b75ae3e803c46426e97823f0f6a9d55.tar.xz apk-tools-ec68b6822b75ae3e803c46426e97823f0f6a9d55.zip |
add: fix segfault when no packages are given
Diffstat (limited to 'src')
-rw-r--r-- | src/add.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -118,7 +118,7 @@ static int add_main(void *ctx, int argc, char **argv) } state = apk_state_new(&db); - for (i = 0; i < pkgs->num; i++) { + for (i = 0; (pkgs != NULL) && i < pkgs->num; i++) { r = apk_state_lock_dependency(state, &pkgs->item[i]); if (r != 0) { apk_error("Unable to install '%s'", pkgs->item[i].name->name); |