fix users with large uid

This commit is contained in:
Luca Conte 2024-11-26 10:44:47 +01:00
parent a23f7d42b3
commit 45dce4ff41
1 changed files with 3 additions and 3 deletions

6
main.c
View File

@ -41,7 +41,7 @@ int bgUsers[1] = {
C_L_GREEN // UID 1000
};
// COLOR FOR USERS UID < 1000
// COLOR FOR USERS UID < 1000 || UID > 1010
int bgUserOther = C_L_YELLOW;
int bgHost = C_L_CYAN;
@ -76,7 +76,7 @@ void seperate(int col1, int col2) {
int main(void) {
char* path_buf = getenv("PWD");
char hostname_buf[1024];
gethostname(hostname_buf, sizeof(hostname_buf));
@ -106,7 +106,7 @@ int main(void) {
uid_t uid = getuid();
if (uid == 0) {
bgUser = bgUserRoot;
} else if (uid >= 1000) {
} else if (uid >= 1000 && uid <= 1010) {
bgUser = bgUsers[uid - 1000];
} else {
bgUser = bgUserOther;