aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEon S. Jeon <esjeon@lavabit.com>2013-08-05 16:37:59 -0400
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2013-08-06 08:32:11 +0200
commit347a45c35299c94e97c976b6e1df383dc2b8fbda (patch)
tree073bfbefd6e2d9a7cb89ff5d3b68be0325769699
parent22eeda56b7c1532773343811dee1f76c0999d01c (diff)
downloadst-patched-347a45c35299c94e97c976b6e1df383dc2b8fbda.tar.bz2
st-patched-347a45c35299c94e97c976b6e1df383dc2b8fbda.tar.xz
st-patched-347a45c35299c94e97c976b6e1df383dc2b8fbda.zip
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.
-rw-r--r--st.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/st.c b/st.c
index 9cdd969..1b01353 100644
--- a/st.c
+++ b/st.c
@@ -362,7 +362,7 @@ static void tsetdirtattr(int);
362static void tsetmode(bool, bool, int *, int); 362static void tsetmode(bool, bool, int *, int);
363static void tfulldirt(void); 363static void tfulldirt(void);
364static void techo(char *, int); 364static void techo(char *, int);
365static ulong tdefcolor(int *, int *, int); 365static long tdefcolor(int *, int *, int);
366static inline bool match(uint, uint); 366static inline bool match(uint, uint);
367static void ttynew(void); 367static void ttynew(void);
368static void ttyread(void); 368static void ttyread(void);
@@ -1626,7 +1626,7 @@ tdeleteline(int n) {
1626 tscrollup(term.c.y, n); 1626 tscrollup(term.c.y, n);
1627} 1627}
1628 1628
1629ulong 1629long
1630tdefcolor(int *attr, int *npar, int l) { 1630tdefcolor(int *attr, int *npar, int l) {
1631 long idx = -1; 1631 long idx = -1;
1632 uint r, g, b; 1632 uint r, g, b;
@@ -1677,7 +1677,7 @@ tdefcolor(int *attr, int *npar, int l) {
1677void 1677void
1678tsetattr(int *attr, int l) { 1678tsetattr(int *attr, int l) {
1679 int i; 1679 int i;
1680 ulong idx; 1680 long idx;
1681 1681
1682 for(i = 0; i < l; i++) { 1682 for(i = 0; i < l; i++) {
1683 switch(attr[i]) { 1683 switch(attr[i]) {