tMake xrealloc and xstrdup style consistent. - st - [fork] customized build of st, the simple terminal
(HTM) git clone git://src.adamsgaard.dk/st
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit fa19f241a34deddf6e089ab462cbd9cb02f61b3d
(DIR) parent df1810dd8fcb7a14f4cd2ff2ec3ce8780591f87f
(HTM) Author: noname <noname@inventati.org>
Date: Tue, 22 Apr 2014 21:59:48 +0400
Make xrealloc and xstrdup style consistent.
Diffstat:
M st.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/st.c b/st.c
t@@ -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