silence coverity warnings

(cherry picked from commit 45b727f651)
This commit is contained in:
Mark Andrews
2013-04-11 17:07:50 +10:00
parent 7bb8b43fb1
commit 53f675154c
8 changed files with 45 additions and 23 deletions

View File

@@ -610,10 +610,11 @@ main(int argc, char *argv[]) {
} else if (strstr(s, "!V") == s) {
DBI_CHECK(dbi);
v = atoi(&s[2]);
if (v >= dbi->rcount) {
if (v >= dbi->rcount || v < 0) {
printf("unknown open version %d\n", v);
continue;
} else if (dbi->rversions[v] == NULL) {
}
if (dbi->rversions[v] == NULL) {
printf("version %d is not open\n", v);
continue;
}