2010-04-13 Ralf Corsépius <ralf.corsepius@rtems.org>

* shttpd/io_dir.c: Cast consts to size_t (Avoid overflows on implicit
	const casts on 16bit targets).
This commit is contained in:
Ralf Corsepius
2010-04-13 04:17:15 +00:00
parent 4d0771e1e8
commit 5322d6e604
2 changed files with 6 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2010-04-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* shttpd/io_dir.c: Cast consts to size_t (Avoid overflows on implicit
const casts on 16bit targets).
2010-04-12 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/system.h: Let RTEMS_offsetof return uintptr_t

View File

@@ -79,7 +79,7 @@ read_dir(struct stream *stream, void *buf, size_t len)
if (st.st_size < 1024)
(void) my_snprintf(size, sizeof(size),
"%lu", (unsigned long) st.st_size);
else if (st.st_size < 1024 * 1024)
else if (st.st_size < ((size_t)1024 * (size_t)1024))
(void) my_snprintf(size, sizeof(size), "%luk",
(unsigned long) (st.st_size >> 10) + 1);
else