nshlib/fscmds:Fix write overflow during cp -r process

Summary:
      do
        {
          nbyteswritten = write(wrfd, iobuffer, nbytesread);
          if (nbyteswritten >= 0)

The write return type is ssize_t, which is different in size from the originally declared type, so the unified type is ssize_t

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2024-03-26 11:31:49 +08:00 committed by Alan Carvalho de Assis
parent 2413a2a4c8
commit f126adb5fc

View File

@ -163,8 +163,8 @@ static int cp_handler(FAR struct nsh_vtbl_s *vtbl, FAR const char *srcpath,
for (; ; )
{
int nbytesread;
int nbyteswritten;
ssize_t nbyteswritten;
ssize_t nbytesread;
FAR char *iobuffer = vtbl->iobuffer;
nbytesread = read(rdfd, iobuffer, IOBUFFERSIZE);