From: Kay Sievers Date: Wed, 8 Apr 2009 13:06:01 +0000 (-0700) Subject: path_encode: fix max length calculation X-Git-Tag: 174~1103 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=662c3110803bd8c1aedacc36788e6fd028944314;p=systemd path_encode: fix max length calculation Sebastian Krahmer wrote: > it should reserve 4 times not 3 times len :) --- diff --git a/udev/lib/libudev-util.c b/udev/lib/libudev-util.c index b628fdd4..a40be067 100644 --- a/udev/lib/libudev-util.c +++ b/udev/lib/libudev-util.c @@ -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++) {