chiark / gitweb /
unit-name: fix unit name escaping
[elogind.git] / src / unit-name.c
index c5901cacfa3bf9c14fd95b91e6a2c8e1a3d42110..868d13e4c99ac6dcc7fe83638221630211c2c551 100644 (file)
@@ -1,4 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
 /***
   This file is part of systemd.
@@ -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;