X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/ed855ea432156cea5ca3c6c942392f97d4c3ab1d..fa19f241a34deddf6e089ab462cbd9cb02f61b3d:/st.c diff --git a/st.c b/st.c index b8bf84b..aba034f 100644 --- a/st.c +++ b/st.c @@ -549,12 +549,10 @@ xrealloc(void *p, size_t len) { char * xstrdup(char *s) { - char *p = strdup(s); - - if (!p) + if((s = strdup(s)) == NULL) die("Out of memory\n"); - return p; + return s; } size_t @@ -1544,8 +1542,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) { * The table is proudly stolen from rxvt. */ if(attr->mode & ATTR_GFX) { - if(c[0] >= 0x41 && c[0] <= 0x7e - && vt100_0[c[0] - 0x41]) { + if(BETWEEN(c[0], 0x41, 0x7e) && vt100_0[c[0] - 0x41]) { c = vt100_0[c[0] - 0x41]; } }