Make minor improvements

This commit is contained in:
Justine Tunney 2020-12-23 23:42:56 -08:00
parent 04caf6f9ad
commit 95b142e4e5
95 changed files with 3818 additions and 2760 deletions

View file

@ -25,7 +25,7 @@
#include "libc/str/internal.h"
/**
* Reads data to stream.
* Reads data from stream.
*
* @param stride specifies the size of individual items
* @param count is the number of strides to fetch
@ -36,7 +36,7 @@ size_t fread(void *buf, size_t stride, size_t count, FILE *f) {
size_t i, n;
unsigned char *p;
for (n = stride * count, p = buf, i = 0; i < n; ++i) {
if ((c = fgetc(f)) != -1) {
if ((c = getc(f)) != -1) {
p[i] = c & 0xff;
} else if (!(i % stride)) {
return i / stride;