Fix unsigned conversion bug.

Since readi() returns -1 for errors, checking with < against an unsigned
value is inadvisable. Checking with != works as intended however.
feat/start
Peter H. Froehlich 2016-09-27 16:58:29 -04:00 committed by Frans Kaashoek
parent 462930727f
commit e916d668f7
1 changed files with 1 additions and 1 deletions

2
exec.c
View File

@ -28,7 +28,7 @@ exec(char *path, char **argv)
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf))
if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
goto bad;
if(elf.magic != ELF_MAGIC)
goto bad;