fix users with large uid
This commit is contained in:
parent
a23f7d42b3
commit
45dce4ff41
6
main.c
6
main.c
|
@ -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;
|
||||
|
|
Reference in New Issue