| 335 |
|
r=0; |
| 336 |
|
w=0; |
| 337 |
|
for(counter=0;counter<stats.disk_io_entries;counter++){ |
| 338 |
+ |
char name[12]; |
| 339 |
+ |
strncpy(name, disk_io_stat_ptr->disk_name, sizeof(name)); |
| 340 |
+ |
name[sizeof(name)-1] = '\0'; /* strncpy doesn't terminate longer strings */ |
| 341 |
|
move(line, 0); |
| 342 |
< |
printw("%s", disk_io_stat_ptr->disk_name); |
| 342 |
> |
printw("%s", name); |
| 343 |
|
move(line, 12); |
| 344 |
|
rt = (disk_io_stat_ptr->systime)? (disk_io_stat_ptr->read_bytes/disk_io_stat_ptr->systime): disk_io_stat_ptr->read_bytes; |
| 345 |
|
printw("%7s", size_conv(rt)); |
| 365 |
|
/* Network */ |
| 366 |
|
network_stat_ptr = stats.network_io_stats; |
| 367 |
|
for(counter=0;counter<stats.network_io_entries;counter++){ |
| 368 |
+ |
char name[20]; |
| 369 |
+ |
strncpy(name, network_stat_ptr->interface_name, sizeof(name)); |
| 370 |
+ |
name[sizeof(name)-1] = '\0'; /* strncpy doesn't terminate longer strings */ |
| 371 |
|
move(line, 42); |
| 372 |
< |
printw("%s", network_stat_ptr->interface_name); |
| 372 |
> |
printw("%s", name); |
| 373 |
|
move(line, 62); |
| 374 |
|
rt = (network_stat_ptr->systime)? (network_stat_ptr->rx / network_stat_ptr->systime): network_stat_ptr->rx; |
| 375 |
|
printw("%7s", size_conv(rt)); |
| 386 |
|
/* Disk */ |
| 387 |
|
disk_stat_ptr = stats.fs_stats; |
| 388 |
|
for(counter=0;counter<stats.fs_entries;counter++){ |
| 389 |
+ |
char name[20]; |
| 390 |
+ |
strncpy(name, disk_stat_ptr->mnt_point, sizeof(name)); |
| 391 |
+ |
name[sizeof(name)-1] = '\0'; /* strncpy doesn't terminate longer strings */ |
| 392 |
|
move(line, 42); |
| 393 |
< |
printw("%s", disk_stat_ptr->mnt_point); |
| 393 |
> |
printw("%s", name); |
| 394 |
|
move(line, 62); |
| 395 |
|
printw("%7s", size_conv(disk_stat_ptr->avail)); |
| 396 |
|
move(line, 73); |