Selaa lähdekoodia

Rewritten this small helper function

Marius Zbihlei 16 vuotta sitten
vanhempi
commit
4fed4c7b9d
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  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';
+
 }