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:
parent
2413a2a4c8
commit
f126adb5fc
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user