testing/smart_test/smart_test.c: fix wrong offset in fseek

To seek to the last 30 bytes of the file, offset from SEEK_END
should be negative.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
This commit is contained in:
Windrow14 2024-07-03 13:54:27 +08:00 committed by Xiang Xiao
parent 5d779386c8
commit 5330306aca

View File

@ -209,7 +209,7 @@ static int smart_append_test(char *filename)
/* Now seek to that position and read the data back */
fseek(fd, 30, SEEK_END);
fseek(fd, -30, SEEK_END);
fread(readstring, 1, 30, fd);
readstring[30] = '\0';
if (strcmp(readstring, "This is a test of the append.\n") != 0)