Mercurial > trustbridge
changeset 90:899fcddb92d0
Check parameters in readInput
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 21 Mar 2014 09:45:54 +0000 |
parents | 00f9b91f4039 |
children | 80ab2168760f |
files | cinst/main.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/cinst/main.c Thu Mar 20 18:40:15 2014 +0000 +++ b/cinst/main.c Fri Mar 21 09:45:54 2014 +0000 @@ -62,6 +62,11 @@ int readingList = 0; char buf[MAX_LINE_LENGTH + 1]; + if (*certificate_list || *to_install || *to_remove) { + printf("Error invalid parameters\n"); + return -1; + } + while (fgets(buf, MAX_LINE_LENGTH + 1, stdin)) { size_t len = strlen(buf); /* fgets ensures buf is terminated */ if (lines_read ++ > MAX_LINES) {