]> err.no Git - systemd/commitdiff
path_encode: fix max length calculation
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 8 Apr 2009 13:06:01 +0000 (06:06 -0700)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 8 Apr 2009 13:06:01 +0000 (06:06 -0700)
Sebastian Krahmer wrote:
> it should reserve 4 times not 3 times len :)

udev/lib/libudev-util.c

index b628fdd44c33a35eea72535b029838c19f0ee76d..a40be067578e164346002410a27c634d61e95d33 100644 (file)
@@ -103,7 +103,7 @@ int util_log_priority(const char *priority)
 
 size_t util_path_encode(char *s, size_t len)
 {
-       char t[(len * 3)+1];
+       char t[(len * 4)+1];
        size_t i, j;
 
        for (i = 0, j = 0; s[i] != '\0'; i++) {