diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2014-06-10 09:36:43 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2014-06-10 09:36:43 +0000 |
commit | a9316351f01d88f059ab97d83d696de0e0f145f4 (patch) | |
tree | e76df250ac0eceba521069bbbb802475f577ab1a /sys/lib | |
parent | b96cedb312c1947b4b6934ddeff7529155e97918 (diff) |
Rearrange the inequality.
Pointed out by LLVM.
tftp.c:331:17: error: comparison of unsigned expression < 0 is always false
From NetBSD
ok miod@
Diffstat (limited to 'sys/lib')
-rw-r--r-- | sys/lib/libsa/tftp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/lib/libsa/tftp.c b/sys/lib/libsa/tftp.c index d685be5ee73..3402326f381 100644 --- a/sys/lib/libsa/tftp.c +++ b/sys/lib/libsa/tftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftp.c,v 1.4 2014/03/28 01:12:58 guenther Exp $ */ +/* $OpenBSD: tftp.c,v 1.5 2014/06/10 09:36:42 brad Exp $ */ /* $NetBSD: tftp.c,v 1.15 2003/08/18 15:45:29 dsl Exp $ */ /* @@ -327,14 +327,14 @@ tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid) offinblock = tftpfile->off % SEGSIZE; - inbuffer = tftpfile->validsize - offinblock; - if (inbuffer < 0) { + if (offinblock > tftpfile->validsize) { #ifdef DEBUG printf("tftp: invalid offset %d\n", tftpfile->off); #endif return EINVAL; } + inbuffer = tftpfile->validsize - offinblock; count = (size < inbuffer ? size : inbuffer); bcopy(tftpfile->lastdata.t.th_data + offinblock, addr, count); |