X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/3e833eea9cb9822f04c639e143212c4b6f7940d4..5d4e3f65125a1e67702b7fbd4096d5e2fd3ec798:/src/util.c diff --git a/src/util.c b/src/util.c index 4d42440..86e44b8 100644 --- a/src/util.c +++ b/src/util.c @@ -81,13 +81,17 @@ remove_sep(const char *base) { char *p; char *s = g_strdup(base); + char *q=s; /* don't eat C++ :: thingies */ if (for_cpp && strstr (s, "::") != NULL) return s; - while((p = strchr(s, ':'))) - strcpy(p, p+1); + for(p=(char *)base;*p;p++){ + if (*p!=':') + *q++=*p; + } + *q='\0'; return s; }