mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/dosfs/msdos_format.c: Rework to avoid overflow on 16-bit targets.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* libfs/src/dosfs/msdos_format.c: Rework to avoid overflow on 16-bit
|
||||||
|
targets.
|
||||||
|
|
||||||
2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* libcsupport/src/open_dev_console.c: Use constant numbers to avoid
|
* libcsupport/src/open_dev_console.c: Use constant numbers to avoid
|
||||||
|
|||||||
@@ -490,7 +490,8 @@ static int msdos_format_determine_fmt_params
|
|||||||
fmt_params->sectors_per_cluster = 2;
|
fmt_params->sectors_per_cluster = 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uint32_t gigs = (total_size + (1024 * 1024 * 1024)) / (1024 * 1024 * 1024);
|
#define ONE_GB (1024L * 1024L * 1024L)
|
||||||
|
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
|
||||||
int b;
|
int b;
|
||||||
fmt_params->fattype = FAT_FAT32;
|
fmt_params->fattype = FAT_FAT32;
|
||||||
/* scale with the size of disk... */
|
/* scale with the size of disk... */
|
||||||
|
|||||||
Reference in New Issue
Block a user