소스 검색

Fix calculation of remaining copybuf bytes

Start with PATH_MAX bytes and then double each time.
master
Arun Prakash Jana 7 년 전
부모
커밋
f652a4fecb
No known key found for this signature in database GPG 키 ID: A75979F35C080412
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. +1
    -2
      nnn.c

+ 1
- 2
nnn.c 파일 보기

@@ -642,7 +642,7 @@ writecp(const char *buf, const size_t buflen)
static bool
appendfilepath(const char *path, const size_t len)
{
if ((copybufpos >= copybuflen) || (len > (copybuflen - (copybufpos + 3)))) {
if ((copybufpos >= copybuflen) || ((len + 3) > (copybuflen - copybufpos))) {
copybuflen += PATH_MAX;
pcopybuf = xrealloc(pcopybuf, copybuflen);
if (!pcopybuf) {
@@ -3055,7 +3055,6 @@ nochange:
writecp(pcopybuf, copybufpos - 1); /* Truncate NULL from end */
else
spawn(copier, pcopybuf, NULL, NULL, F_NOTRACE);
DPRINTF_S(pcopybuf);
if (!len)
printmsg("files copied");
} else


불러오는 중...
취소
저장