Skip to content

Commit ea2c206

Browse files
committed
Fix implicit type casting warning
1 parent 9ff0af1 commit ea2c206

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/_libs/src/parser/tokenizer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,10 @@ static inline int str_consume_nspan(char **dst, size_t dst_sz, const char **src,
17401740
if (span_sz > src_sz) {
17411741
span_sz = src_sz;
17421742
}
1743+
// Assuming the span size is within the expected range.
1744+
if (span_sz > INT_MAX) {
1745+
return -1;
1746+
}
17431747
if (dst) {
17441748
if (span_sz > dst_sz) {
17451749
return -1;
@@ -1748,7 +1752,7 @@ static inline int str_consume_nspan(char **dst, size_t dst_sz, const char **src,
17481752
*dst += span_sz;
17491753
}
17501754
*src += span_sz;
1751-
return span_sz;
1755+
return (int)span_sz;
17521756
}
17531757

17541758
static inline int str_consume_span(char **dst, size_t dst_sz, const char **src,

0 commit comments

Comments
 (0)