From: noname Date: Tue, 22 Apr 2014 17:59:48 +0000 (+0400) Subject: Make xrealloc and xstrdup style consistent. X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=fa19f241a34deddf6e089ab462cbd9cb02f61b3d;p=st.git Make xrealloc and xstrdup style consistent. --- diff --git a/st.c b/st.c index bb3e687..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