Mercurial > trustbridge
comparison cinst/main.c @ 90:899fcddb92d0
Check parameters in readInput
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 21 Mar 2014 09:45:54 +0000 |
parents | 8ffbb48528ae |
children | 80ab2168760f |
comparison
equal
deleted
inserted
replaced
89:00f9b91f4039 | 90:899fcddb92d0 |
---|---|
59 char ***to_remove) | 59 char ***to_remove) |
60 { | 60 { |
61 int lines_read = 0; | 61 int lines_read = 0; |
62 int readingList = 0; | 62 int readingList = 0; |
63 char buf[MAX_LINE_LENGTH + 1]; | 63 char buf[MAX_LINE_LENGTH + 1]; |
64 | |
65 if (*certificate_list || *to_install || *to_remove) { | |
66 printf("Error invalid parameters\n"); | |
67 return -1; | |
68 } | |
64 | 69 |
65 while (fgets(buf, MAX_LINE_LENGTH + 1, stdin)) { | 70 while (fgets(buf, MAX_LINE_LENGTH + 1, stdin)) { |
66 size_t len = strlen(buf); /* fgets ensures buf is terminated */ | 71 size_t len = strlen(buf); /* fgets ensures buf is terminated */ |
67 if (lines_read ++ > MAX_LINES) { | 72 if (lines_read ++ > MAX_LINES) { |
68 printf("Too many lines\n"); | 73 printf("Too many lines\n"); |