michallenc commented on code in PR #10602: URL: https://github.com/apache/nuttx/pull/10602#discussion_r1361767837
########## libs/libc/stdio/lib_libfgets.c: ########## @@ -97,10 +97,11 @@ FAR char *lib_fgets_unlocked(FAR char *buf, size_t buflen, FILE *stream, bool keepnl, bool consume) { size_t nch = 0; + int fd = (int)(intptr_t)stream->fs_cookie; /* Sanity checks */ - if (!stream || !buf || stream->fs_fd < 0) + if (!stream || !buf || fd < 0) Review Comment: I suppose we could remove `fd < 0` as this is checked by write/read/seek/close operations further in the code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org