소스 검색

Make xrealloc and xstrdup style consistent.

noname 11 년 전
부모
커밋
fa19f241a3
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      st.c

+ 2 - 4
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