From: Colin Guthrie Date: Sat, 18 Aug 2012 10:38:02 +0000 (+0100) Subject: install/dracut-install.c: No need to compare the NULL byte each time. X-Git-Tag: 024~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68c49db95233d03a25b27e01709cd052d60cef7a;p=thirdparty%2Fdracut.git install/dracut-install.c: No need to compare the NULL byte each time. --- diff --git a/install/dracut-install.c b/install/dracut-install.c index dfee25963..c95b7c250 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -63,7 +63,7 @@ static size_t dir_len(char const *file) { size_t length; /* Strip the basename and any redundant slashes before it. */ - for (length = strlen(file); 0 < length; length--) + for (length = strlen(file)-1; 0 < length; length--) if (file[length] == '/' && file[length-1] != '/') break; return length;