[hackers] [st] Make xrealloc and xstrdup style consistent. || noname

From: <git_AT_suckless.org>
Date: Wed, 23 Apr 2014 15:39:58 +0200

commit fa19f241a34deddf6e089ab462cbd9cb02f61b3d
Author: noname <noname_AT_inventati.org>
Date: Tue Apr 22 21:59:48 2014 +0400

    Make xrealloc and xstrdup style consistent.

diff --git a/st.c b/st.c
index bb3e687..aba034f 100644
--- a/st.c
+++ b/st.c
_AT_@ -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
");
 
- return p;
+ return s;
 }
 
 size_t
Received on Wed Apr 23 2014 - 15:39:58 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 23 2014 - 15:48:12 CEST