Skip to content

Commit 5cbb6f0

Browse files
committed
Move to long long parsing, which guarantees at least 64 bits and is more cross-platform compatible.
1 parent e1e40d4 commit 5cbb6f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

table.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ void table_t::escape_type(const string &value, ColumnType flags)
457457
switch (flags) {
458458
case COLUMN_TYPE_INT: {
459459
// For integers we take the first number, or the average if it's a-b
460-
int64_t from, to;
460+
long long from, to;
461461
// limit number of digits parsed to avoid undefined behaviour in sscanf
462-
int items = sscanf(value.c_str(), "%18ld-%18ld", &from, &to);
462+
int items = sscanf(value.c_str(), "%18Ld-%18Ld", &from, &to);
463463
if (items == 1 && from <= std::numeric_limits<int32_t>::max() &&
464464
from >= std::numeric_limits<int32_t>::min()) {
465465
m_copy.add_column(from);

0 commit comments

Comments
 (0)