Skip to content

Commit 70e189f

Browse files
[libc] fixup ftello test (#87282)
Use a seek offset that fits within the file size. This was missed in presubmit because the FILE based stdio tests aren't run in overlay mode; fullbuild is not tested in presubmit. WRITE_SIZE == 11, so using a value of 42 for offseto would cause the expression `WRITE_SIZE - offseto` to evaluate to -31 as an unsigned 64b integer (18446744073709551585ULL). Fixes #86928
1 parent 03577ce commit 70e189f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/test/src/stdio/ftell_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class LlvmLibcFTellTest : public LIBC_NAMESPACE::testing::Test {
3939
// still return the correct effective offset.
4040
ASSERT_EQ(size_t(LIBC_NAMESPACE::ftell(file)), WRITE_SIZE);
4141

42-
off_t offseto = 42;
42+
off_t offseto = 5;
4343
ASSERT_EQ(0, LIBC_NAMESPACE::fseeko(file, offseto, SEEK_SET));
4444
ASSERT_EQ(LIBC_NAMESPACE::ftello(file), offseto);
4545
ASSERT_EQ(0, LIBC_NAMESPACE::fseeko(file, -offseto, SEEK_END));

0 commit comments

Comments
 (0)