summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/util.c b/util.c
index 17ee09c1f7..5f36819fa3 100644
--- a/util.c
+++ b/util.c
@@ -1041,16 +1041,15 @@ char *bus_path_escape(const char *s) {
return r;
}
-char *bus_path_unescape(const char *s) {
+char *bus_path_unescape(const char *f) {
char *r, *t;
- const char *f;
- assert(s);
+ assert(f);
- if (!(r = new(char, strlen(s)+1)))
+ if (!(r = strdup(f)))
return NULL;
- for (f = s, t = r; *f; f++) {
+ for (t = r; *f; f++) {
if (*f == '_') {
int a, b;