Re: cvs: php4 /main memory_streams.c

From: Date: Wed, 20 Mar 2002 23:10:35 +0000
Subject: Re: cvs: php4 /main memory_streams.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10503@lists.php.net to get a copy of this message
Harald Radi wrote:
phanto Wed Mar 20 14:13:04 2002 EDT
  Modified files:                  /php4/main	memory_streams.c   Log:
fixed signed/unsigned comparison warnings
It seems assertion is better to be used. Could you add assertion? -- Yasuo Ohgaki
Index: php4/main/memory_streams.c diff -u php4/main/memory_streams.c:1.9 php4/main/memory_streams.c:1.10 --- php4/main/memory_streams.c:1.9 Tue Mar 19 18:29:37 2002 +++ php4/main/memory_streams.c Wed Mar 20 14:13:03 2002 @@ -153,14 +153,14 @@ switch(whence) { case SEEK_CUR: if (offset < 0) { - if (ms->fpos < -offset) { + if (ms->fpos < (size_t)(-offset)) { ms->fpos = 0; /*return EINVAL;*/ } else { ms->fpos = ms->fpos + offset; } } else { - if (ms->fpos < offset) { + if (ms->fpos < (size_t)(offset)) { ms->fpos = ms->fsize; /*return EINVAL;*/ } else { @@ -169,7 +169,7 @@ } return 0; case SEEK_SET: - if (offset > ms->fsize) { + if (ms->fsize < (size_t)(offset)) { ms->fpos = ms->fsize; /*return EINVAL;*/ } else { @@ -180,7 +180,7 @@ if (offset > 0) { ms->fpos = ms->fsize; /*return EINVAL;*/ - } else if (ms->fpos < -offset) { + } else if (ms->fpos < (size_t)(-offset)) { ms->fpos = 0; /*return EINVAL;*/ } else {


« previous php.cvs (#10503) next »