Page MenuHomeFreeBSD

D33903.diff
No OneTemporary

D33903.diff

diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c
--- a/lib/libc/stdio/fread.c
+++ b/lib/libc/stdio/fread.c
@@ -129,11 +129,13 @@
}
while (resid > (r = fp->_r)) {
- (void)memcpy((void *)p, (void *)fp->_p, (size_t)r);
- fp->_p += r;
- /* fp->_r = 0 ... done in __srefill */
- p += r;
- resid -= r;
+ if (r != 0) {
+ (void)memcpy((void *)p, (void *)fp->_p, (size_t)r);
+ fp->_p += r;
+ /* fp->_r = 0 ... done in __srefill */
+ p += r;
+ resid -= r;
+ }
if (__srefill(fp)) {
/* no more input: return partial result */
return ((total - resid) / size);

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 2:41 AM (22 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14728337
Default Alt Text
D33903.diff (594 B)

Event Timeline