diff --git a/config.h b/config.h index e95d8a4..602c678 100644 --- a/config.h +++ b/config.h @@ -1,8 +1,8 @@ #include "defs.h" -const int max_username_length = 128; -const int max_hostname_length = 128; -const int max_uptime_length = 40; +#define MAX_USERNAME_LENGTH 128 +#define MAX_HOSTNAME_LENGTH 128 +#define MAX_UPTIME_LENGTH 40 struct art_entry arts[] = { { diff --git a/mycfetch.c b/mycfetch.c index 7842264..874e8f5 100644 --- a/mycfetch.c +++ b/mycfetch.c @@ -61,21 +61,21 @@ int main(int argc, char **argv) art = arts[0].art; } - char hostname[max_hostname_length]; - char username[max_username_length]; - char uptime[max_uptime_length]; + char hostname[MAX_HOSTNAME_LENGTH]; + char username[MAX_USERNAME_LENGTH]; + char uptime[MAX_UPTIME_LENGTH]; #ifdef _WIN32 RTL_OSVERSIONINFOW version_buffer = {.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOW)}; RtlGetVersion(&version_buffer); - GetUserNameA(username, max_username_length); + GetUserNameA(username, MAX_USERNAME_LENGTH); #else struct utsname uname_buf; - getlogin_r(username, max_username_length); + getlogin_r(username, MAX_USERNAME_LENGTH); uname(&uname_buf); #endif - gethostname(hostname, max_hostname_length); - getuptime(uptime, max_uptime_length); + gethostname(hostname, MAX_HOSTNAME_LENGTH); + getuptime(uptime, MAX_UPTIME_LENGTH); printf("%s %s@%s\n", art[0], username, hostname); printf("%s --\n", art[1]);