diff options
author | Peter H. Froehlich <[email protected]> | 2016-09-27 16:58:29 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2017-01-30 19:31:24 -0500 |
commit | e916d668f7b184c41ee3d912ccda8cc7ca4aa765 (patch) | |
tree | 315e85ce1da63dd0452130484942a81efd4ae111 /exec.c | |
parent | 462930727fa9a9d61912264683d9f26e992412c6 (diff) | |
download | xv6-labs-e916d668f7b184c41ee3d912ccda8cc7ca4aa765.tar.gz xv6-labs-e916d668f7b184c41ee3d912ccda8cc7ca4aa765.tar.bz2 xv6-labs-e916d668f7b184c41ee3d912ccda8cc7ca4aa765.zip |
Fix unsigned conversion bug.
Since readi() returns -1 for errors, checking with < against an unsigned
value is inadvisable. Checking with != works as intended however.
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |