fix
This commit is contained in:
parent
69ddc38152
commit
7ab3e8ef0c
3 changed files with 12 additions and 0 deletions
10
src/fetch.c
10
src/fetch.c
|
@ -5,6 +5,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <sys/utsname.h>
|
||||
#include "fetch.h"
|
||||
#include "config.h"
|
||||
|
@ -231,3 +232,12 @@ int GetModel(const char *title, const FETCH fetch) {
|
|||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetHostname(const char *title, const FETCH fetch) {
|
||||
char hostname[HOST_NAME_MAX + 1];
|
||||
if (gethostname(hostname, sizeof(hostname)) < 0)
|
||||
return 1;
|
||||
|
||||
printf("%s%s%s%s", fetch.color, title, fetch.font_color, hostname);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue