summaryrefslogtreecommitdiffstats
path: root/src/win32.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-10-24 20:30:19 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2010-10-24 20:30:19 +0200
commit7fbc038d1e62f4211aef0b0cc68d4be98f7df3a3 (patch)
treed4c9e19cbb1f828e8333ec6111660c0af91c5ecb /src/win32.c
parentc9cd19d63db1dd2011370ee0bfc90ecc518f8ae2 (diff)
New prototype for size_to_unit()
Diffstat (limited to 'src/win32.c')
-rw-r--r--src/win32.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/win32.c b/src/win32.c
index 6c1c109..6ad7696 100644
--- a/src/win32.c
+++ b/src/win32.c
@@ -345,14 +345,15 @@ static const char *file_win32_description(disk_t *disk_car)
{
struct info_file_win32_struct *data=disk_car->data;
char buffer_disk_size[100];
+ size_to_unit(disk_car->disk_size, buffer_disk_size);
if(disk_car->device[0]=='\\' && disk_car->device[1]=='\\' && disk_car->device[2]=='.' && disk_car->device[3]=='\\' && disk_car->device[5]==':')
snprintf(disk_car->description_txt, sizeof(disk_car->description_txt),"Drive %c: - %s - CHS %lu %u %u%s",
- disk_car->device[4], size_to_unit(disk_car->disk_size,buffer_disk_size),
+ disk_car->device[4], buffer_disk_size,
disk_car->geom.cylinders, disk_car->geom.heads_per_cylinder, disk_car->geom.sectors_per_head,
((data->mode&FILE_WRITE_DATA)==FILE_WRITE_DATA?"":" (RO)"));
else
snprintf(disk_car->description_txt, sizeof(disk_car->description_txt),"Disk %s - %s - CHS %lu %u %u%s",
- disk_car->device, size_to_unit(disk_car->disk_size,buffer_disk_size),
+ disk_car->device, buffer_disk_size,
disk_car->geom.cylinders, disk_car->geom.heads_per_cylinder, disk_car->geom.sectors_per_head,
((data->mode&FILE_WRITE_DATA)==FILE_WRITE_DATA?"":" (RO)"));
return disk_car->description_txt;
@@ -362,17 +363,18 @@ static const char *file_win32_description_short(disk_t *disk_car)
{
struct info_file_win32_struct *data=disk_car->data;
char buffer_disk_size[100];
+ size_to_unit(disk_car->disk_size, buffer_disk_size);
if(disk_car->device[0]=='\\' && disk_car->device[1]=='\\' && disk_car->device[2]=='.' && disk_car->device[3]=='\\' && disk_car->device[5]==':')
{
if(disk_car->model==NULL)
snprintf(disk_car->description_short_txt,
sizeof(disk_car->description_txt), "Drive %c: - %s%s",
- disk_car->device[4], size_to_unit(disk_car->disk_size,buffer_disk_size),
+ disk_car->device[4], buffer_disk_size,
((data->mode&FILE_WRITE_DATA)==FILE_WRITE_DATA?"":" (RO)"));
else
snprintf(disk_car->description_short_txt,
sizeof(disk_car->description_txt), "Drive %c: - %s%s - %s",
- disk_car->device[4], size_to_unit(disk_car->disk_size,buffer_disk_size),
+ disk_car->device[4], buffer_disk_size,
((data->mode&FILE_WRITE_DATA)==FILE_WRITE_DATA?"":" (RO)"),
disk_car->model);
}
@@ -381,12 +383,12 @@ static const char *file_win32_description_short(disk_t *disk_car)
if(disk_car->model==NULL)
snprintf(disk_car->description_short_txt,
sizeof(disk_car->description_txt), "Disk %s - %s%s",
- disk_car->device, size_to_unit(disk_car->disk_size,buffer_disk_size),
+ disk_car->device, buffer_disk_size,
((data->mode&FILE_WRITE_DATA)==FILE_WRITE_DATA?"":" (RO)"));
else
snprintf(disk_car->description_short_txt,
sizeof(disk_car->description_txt), "Disk %s - %s%s - %s",
- disk_car->device, size_to_unit(disk_car->disk_size,buffer_disk_size),
+ disk_car->device, buffer_disk_size,
((data->mode&FILE_WRITE_DATA)==FILE_WRITE_DATA?"":" (RO)"),
disk_car->model);
}