소스 검색

Rewritten this small helper function

Marius Zbihlei 16 년 전
부모
커밋
4fed4c7b9d
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      modules/utils/conf.c

+ 4 - 4
modules/utils/conf.c

@@ -79,11 +79,11 @@ static int fwd_max_id = 0;
 static void remove_spaces(char *s)
 {
 	char *p, *dst;
-
-	for (p = s, dst = s; *dst != '\0'; ++p, ++dst) {
-		while (isspace(*p)) ++p;
-		*dst = *p;
+	for (p = s, dst = s; *p != '\0'; ++p) {
+		if (!isspace(*p)) *dst++ = *p;
 	}
+	*dst = '\0';
+
 }