]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - util.c
gitattributes for whitespace
[xonotic/gmqcc.git] / util.c
diff --git a/util.c b/util.c
index 95736e133f9221b42868d6860144b94c05fa6248..7cf781212d9a822241b1348c645a54d489a44643 100644 (file)
--- a/util.c
+++ b/util.c
@@ -126,14 +126,12 @@ char *util_strrq(const char *s) {
 char *util_strchp(const char *s, const char *e) {
     if (!s || !e)
         return NULL;
+
+    const char *c = s;    
+    while (c != e)
+        c++;
         
-    size_t m  = 0;
-    char  *c  = util_strdup(s);
-    while (s != e)
-        s++,c++,m++;
-         
-    *c = '\0';
-    return c-m;
+    return util_strdup(s);
 }
 
 /*