mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-28 01:50:22 +00:00
avoid arithmetic overflow in the examples/file/readspeed.c and writespeed.c
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1916 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -63,7 +63,7 @@ void writespeed(const char* filename, int total_length, int block_size)
|
||||
rt_free(buff_ptr);
|
||||
|
||||
/* calculate write speed */
|
||||
rt_kprintf("File write speed: %d byte/s\n", total_length*RT_TICK_PER_SECOND/tick);
|
||||
rt_kprintf("File write speed: %d byte/s\n", total_length / tick * RT_TICK_PER_SECOND);
|
||||
}
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
|
||||
Reference in New Issue
Block a user