]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
install/dracut-install.c: No need to compare the NULL byte each time.
authorColin Guthrie <colin@mageia.org>
Sat, 18 Aug 2012 10:38:02 +0000 (11:38 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 21 Aug 2012 16:46:20 +0000 (18:46 +0200)
install/dracut-install.c

index dfee259632ab130a36dd2c1461ffd99bf182dc3c..c95b7c2502066b63621248b0965d630f6757ce61 100644 (file)
@@ -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;