Skip to content

Commit f4b8b99

Browse files
committed
added explaination comment
1 parent efe333e commit f4b8b99

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fread.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,9 @@ static void parse_double_hexadecimal(FieldParseContext *ctx)
929929

930930
bool subnormal = false;
931931

932+
// Important!
933+
// Keep in mind that only ch[0] is guaranteed to be mapped.
934+
// Rearanging these checks will lead to segfault in rare cases.
932935
if (ch[0] == '0' && (ch[1] == 'x' || ch[1] == 'X') &&
933936
(ch[2] == '1' || (subnormal = (ch[2] == '0'))) && ch[3] == '.') {
934937
ch += 4;

0 commit comments

Comments
 (0)