diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index 3babedfd3..4dd8f4141 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -88,7 +88,7 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, return 0; } - len = read(fd, buffer, sizeof(buffer)); + len = read(fd, buffer, sizeof(buffer) - 1); close(fd); if (len < 0) {