Fix signess of tdefcolor
tdefcolor() returns -1 on error, while its return type is unsigned long. At the same time, line 1724 and 1731 are checking the positivity of its unsigned return value.
This commit is contained in:
		
							parent
							
								
									22eeda56b7
								
							
						
					
					
						commit
						347a45c352
					
				
							
								
								
									
										6
									
								
								st.c
								
								
								
								
							
							
						
						
									
										6
									
								
								st.c
								
								
								
								
							| 
						 | 
					@ -362,7 +362,7 @@ static void tsetdirtattr(int);
 | 
				
			||||||
static void tsetmode(bool, bool, int *, int);
 | 
					static void tsetmode(bool, bool, int *, int);
 | 
				
			||||||
static void tfulldirt(void);
 | 
					static void tfulldirt(void);
 | 
				
			||||||
static void techo(char *, int);
 | 
					static void techo(char *, int);
 | 
				
			||||||
static ulong tdefcolor(int *, int *, int);
 | 
					static long tdefcolor(int *, int *, int);
 | 
				
			||||||
static inline bool match(uint, uint);
 | 
					static inline bool match(uint, uint);
 | 
				
			||||||
static void ttynew(void);
 | 
					static void ttynew(void);
 | 
				
			||||||
static void ttyread(void);
 | 
					static void ttyread(void);
 | 
				
			||||||
| 
						 | 
					@ -1626,7 +1626,7 @@ tdeleteline(int n) {
 | 
				
			||||||
	tscrollup(term.c.y, n);
 | 
						tscrollup(term.c.y, n);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ulong
 | 
					long
 | 
				
			||||||
tdefcolor(int *attr, int *npar, int l) {
 | 
					tdefcolor(int *attr, int *npar, int l) {
 | 
				
			||||||
	long idx = -1;
 | 
						long idx = -1;
 | 
				
			||||||
	uint r, g, b;
 | 
						uint r, g, b;
 | 
				
			||||||
| 
						 | 
					@ -1677,7 +1677,7 @@ tdefcolor(int *attr, int *npar, int l) {
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
tsetattr(int *attr, int l) {
 | 
					tsetattr(int *attr, int l) {
 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
	ulong idx;
 | 
						long idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for(i = 0; i < l; i++) {
 | 
						for(i = 0; i < l; i++) {
 | 
				
			||||||
		switch(attr[i]) {
 | 
							switch(attr[i]) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue