# | Line 71 | Line 71 | putbinary( /* fwrite() replacement for small objects | |
---|---|---|
71 | const char *s = (const char *)p; | |
72 | int nbytes = elsiz*nel; | |
73 | ||
74 | < | if (nbytes > 512) |
74 | > | if (nbytes > 256) |
75 | return(fwrite(p, elsiz, nel, fp)); | |
76 | ||
77 | while (nbytes-- > 0) | |
78 | < | putc(*s++, fp); |
78 | > | if (putc(*s++, fp) == EOF) |
79 | > | return((elsiz*nel - nbytes)/elsiz); |
80 | ||
81 | return(nel); | |
82 | } | |
# | Line 152 | Line 153 | getbinary( /* fread() replacement for small objects | |
153 | int nbytes = elsiz*nel; | |
154 | int c; | |
155 | ||
156 | < | if (nbytes > 512) |
156 | > | if (nbytes > 256) |
157 | return(fread(p, elsiz, nel, fp)); | |
158 | ||
159 | while (nbytes-- > 0) { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |