소스 검색

Rewritten this small helper function
(cherry picked from commit 4fed4c7b9db9ca8ad1b034d5afbd86fea4ebd6ba)

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

+ 4 - 4
modules/utils/conf.c

@@ -75,11 +75,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';
+
 }