src/streams.c

changeset 1065
6eb7b54975ee
parent 971
cc204fc56c9c
equal deleted inserted replaced
1064:f3b04cd60776 1065:6eb7b54975ee
56 if (bufsize == 0) return 0; 56 if (bufsize == 0) return 0;
57 lbuf = buf; 57 lbuf = buf;
58 } else { 58 } else {
59 if (bufsize == 0) bufsize = CX_STREAM_BCOPY_BUF_SIZE; 59 if (bufsize == 0) bufsize = CX_STREAM_BCOPY_BUF_SIZE;
60 lbuf = malloc(bufsize); 60 lbuf = malloc(bufsize);
61 if (lbuf == NULL) { 61 if (lbuf == NULL) return 0;
62 return 0;
63 }
64 } 62 }
65 63
66 size_t r; 64 size_t r;
67 size_t rn = bufsize > n ? n : bufsize; 65 size_t rn = bufsize > n ? n : bufsize;
68 while ((r = rfnc(lbuf, 1, rn, src)) != 0) { 66 while ((r = rfnc(lbuf, 1, rn, src)) != 0) {

mercurial