Skip to content

Commit

Permalink
readability
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Jul 12, 2023
1 parent b12028e commit b0a5226
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions c/driver/sqlite/statement_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,19 @@ static const char* ArrowTimestampToIsoString(int64_t value, enum ArrowTimeUnit u
break;
}

int64_t seconds = value / scale;
time_t time;
const int64_t seconds = value / scale;

#if SIZEOF_TIME_T < 8
if ((seconds > INT32_MAX) || (seconds < INT32_MIN)) {
// TODO: give better error visibility
return NULL;
}
time = (time_t)seconds;
const time_t time = (time_t)seconds;
#else
time = seconds;
const time_t time = seconds;
#endif

rem = value % scale;

if (rem < 0) {
rem = scale + rem;
}
Expand Down

0 comments on commit b0a5226

Please sign in to comment.