chiark / gitweb /
unit-name: fix unit name escaping
authorMike Kelly <pioto@pioto.org>
Fri, 1 Oct 2010 23:58:07 +0000 (19:58 -0400)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Oct 2010 19:23:30 +0000 (21:23 +0200)
we want to do a bitwise shift, not a greater-than comparision

src/unit-name.c

index 2e2948ab1d1f13ed701ee4e793ef5f1e0b90347b..868d13e4c99ac6dcc7fe83638221630211c2c551 100644 (file)
@@ -211,7 +211,7 @@ static char* do_escape(const char *f, char *t) {
                 else if (*f == '-' || *f == '\\' || !strchr(VALID_CHARS, *f)) {
                         *(t++) = '\\';
                         *(t++) = 'x';
-                        *(t++) = hexchar(*f > 4);
+                        *(t++) = hexchar(*f >> 4);
                         *(t++) = hexchar(*f);
                 } else
                         *(t++) = *f;