Skip to content

Commit a4378be

Browse files
committed
Make hdtSearch handle large offset error
1 parent 2c90ed0 commit a4378be

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

libhdt/tools/hdtSearch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ void iterate(HDT *hdt, char *query, ostream &out, bool measure, uint32_t offset)
100100
}
101101
catch (const runtime_error error) {
102102
/*invalid offset*/
103+
interruptSignal = 1;
103104
}
104105
}
105106
else {
@@ -147,7 +148,7 @@ int main(int argc, char **argv) {
147148
break;
148149
case 'f':
149150
sstream << optarg;
150-
sstream >> offset;
151+
if(!(sstream >> offset)) offset=0;
151152
break;
152153
case 'm':
153154
measure = true;

0 commit comments

Comments
 (0)