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

4
main.c
View File

@ -41,7 +41,7 @@ int bgUsers[1] = {
C_L_GREEN // UID 1000 C_L_GREEN // UID 1000
}; };
// COLOR FOR USERS UID < 1000 // COLOR FOR USERS UID < 1000 || UID > 1010
int bgUserOther = C_L_YELLOW; int bgUserOther = C_L_YELLOW;
int bgHost = C_L_CYAN; int bgHost = C_L_CYAN;
@ -106,7 +106,7 @@ int main(void) {
uid_t uid = getuid(); uid_t uid = getuid();
if (uid == 0) { if (uid == 0) {
bgUser = bgUserRoot; bgUser = bgUserRoot;
} else if (uid >= 1000) { } else if (uid >= 1000 && uid <= 1010) {
bgUser = bgUsers[uid - 1000]; bgUser = bgUsers[uid - 1000];
} else { } else {
bgUser = bgUserOther; bgUser = bgUserOther;