浏览代码

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';
+
 }