]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
installer: Fix off-by-one error in number search
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Sep 2014 18:10:24 +0000 (20:10 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Sep 2014 18:10:24 +0000 (20:10 +0200)
src/installer/hw.c

index 6d3389a6bb4e19b2f78ca20032b5cf3e1bf6f259..ba7fda267a371fe15e445379b58be22f2ec824a9 100644 (file)
@@ -364,7 +364,7 @@ static int hw_device_has_p_suffix(const struct hw_destination* dest) {
 
        // Devices with a number at the end have the p suffix, too.
        // e.g. mmcblk0, cciss0
-       unsigned int last_char = strlen(dest->path);
+       unsigned int last_char = strlen(dest->path) - 1;
        if ((dest->path[last_char] >= '0') && (dest->path[last_char] <= '9'))
                return 1;