diff --git a/lib/libc/file.c b/lib/libc/file.c index a86cfd7..896fce5 100644 --- a/lib/libc/file.c +++ b/lib/libc/file.c @@ -37,7 +37,9 @@ static FILE fds[FOPEN_MAX] = { FILE * _alloc_file() { - for (int i = 0; i < FOPEN_MAX; i++) { + int i; + + for (i = 0; i < FOPEN_MAX; i++) { if (fds[i].in_use == 0) { fds[i].in_use = 1; return &fds[i]; diff --git a/sys/dev/console.c b/sys/dev/console.c index c60be96..6d91f6a 100644 --- a/sys/dev/console.c +++ b/sys/dev/console.c @@ -151,6 +151,7 @@ Console_Read(Handle *handle, void *buf, uint64_t off, uint64_t len) int Console_Write(Handle *handle, void *buf, uint64_t off, uint64_t len) { + int i; uintptr_t b = (uintptr_t)buf; char kbuf[512]; uint64_t nbytes = 0; @@ -160,7 +161,7 @@ Console_Write(Handle *handle, void *buf, uint64_t off, uint64_t len) CopyIn(b + nbytes, &kbuf, chunksz); nbytes += chunksz; - for (int i = 0; i < chunksz; i++) + for (i = 0; i < chunksz; i++) Console_Putc(kbuf[i]); }