chiark / gitweb /
Use strlen even for constant strings
[elogind.git] / src / sysctl / sysctl.c
index 8868732ad1352230fbb2e5ff1b4c9d2cd4ef8202..283eefe1a1d233e49786034668d64c80cbe507f6 100644 (file)
@@ -65,7 +65,7 @@ static int apply_sysctl(const char *property, const char *value) {
 
         log_debug("Setting '%s' to '%s'", property, value);
 
-        p = new(char, sizeof("/proc/sys/") + strlen(property));
+        p = new(char, strlen("/proc/sys/") + strlen(property) + 1);
         if (!p)
                 return log_oom();