solve CI compilation error problem

Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
This commit is contained in:
fengxuesong 2023-09-04 16:12:12 +08:00 committed by Petro Karashchenko
parent a5ef6d57c1
commit ee0bc579c1

View File

@ -146,10 +146,10 @@ int main(int argc, FAR char *argv[])
printf("open successful\n"); printf("open successful\n");
len = read(fd, buf, sizeof(buf)); len = read(fd, buf, sizeof(buf));
buf[len] = '\0';
if (len) if (len >= 0)
{ {
buf[len] = '\0';
printf("read(\"%s\") successful\n", buf); printf("read(\"%s\") successful\n", buf);
} }
else else