[sr-dev] git:sr_3.0: Rewritten this small helper function

Henning Westerholt henning.westerholt at 1und1.de
Thu Oct 29 14:18:55 CET 2009


Module: sip-router
Branch: sr_3.0
Commit: 895e166d730efe6a975136b69171a9f097243771
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=895e166d730efe6a975136b69171a9f097243771

Author: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Tue Oct 27 13:26:55 2009 +0200

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

---

 modules/utils/conf.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/utils/conf.c b/modules/utils/conf.c
index 0ba4feb..5df2a16 100644
--- a/modules/utils/conf.c
+++ b/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';
+
 }
 
 




More information about the sr-dev mailing list