add: fix segfault when no params are given

cute-signatures
Linux User 2009-05-21 20:24:07 +00:00
parent 0906a1c7de
commit 651aa71ac2
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ static int add_main(void *ctx, int argc, char **argv)
struct apk_dependency virtdep; struct apk_dependency virtdep;
int i, r; int i, r;
if (strcmp(argv[0], "starwars") == 0) if ((argc > 0) && (apk_verbosity > 1) &&
(strcmp(argv[0], "starwars") == 0))
return system("telnet towel.blinkenlights.nl"); return system("telnet towel.blinkenlights.nl");
r = apk_db_open(&db, apk_root, actx->open_flags | APK_OPENF_WRITE); r = apk_db_open(&db, apk_root, actx->open_flags | APK_OPENF_WRITE);