Re: cvs: php4 /main memory_streams.c
| From: | Yasuo Ohgaki | 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 EDTIt seems assertion is better to be used. Could you add assertion? -- Yasuo OhgakiModified files: /php4/main memory_streams.c Log:fixed signed/unsigned comparison warnings
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 {