205 |
|
diskio_stat_t *diskio_stat_ptr; |
206 |
|
network_stat_t *network_stat_ptr; |
207 |
|
disk_stat_t *disk_stat_ptr; |
208 |
+ |
/* Size before it will start overwriting "uptime" */ |
209 |
+ |
char hostname[15]; |
210 |
+ |
char *ptr; |
211 |
|
|
212 |
|
move(0,12); |
213 |
< |
printw("%s", stats.general_stats->hostname); |
213 |
> |
strncpy(hostname, stats.general_stats->hostname, sizeof(hostname)); |
214 |
> |
ptr=strchr(hostname, '.'); |
215 |
> |
/* Some hosts give back a FQDN for hostname. To avoid this, we'll |
216 |
> |
* just blank out everything after the first "." |
217 |
> |
*/ |
218 |
> |
if (ptr != NULL){ |
219 |
> |
*ptr = '\0'; |
220 |
> |
} |
221 |
> |
printw("%s", hostname); |
222 |
|
move(0,36); |
223 |
|
printw("%s", hr_uptime(stats.general_stats->uptime)); |
224 |
|
epoc_time=time(NULL); |