From 5d54b6c408dd1b77547d3733578a645d539bdc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 29 Mar 2008 14:10:46 +0000 Subject: [PATCH] followed Ingo and Marcus' suggestion : be nice when called on file names shorter than raw, or when called in the device directory git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24653 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/makebootable/platform/bios_ia32/makebootable.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/makebootable/platform/bios_ia32/makebootable.cpp b/src/bin/makebootable/platform/bios_ia32/makebootable.cpp index f6cf961594..44c3fb9148 100644 --- a/src/bin/makebootable/platform/bios_ia32/makebootable.cpp +++ b/src/bin/makebootable/platform/bios_ia32/makebootable.cpp @@ -478,7 +478,9 @@ main(int argc, const char *const *argv) #ifdef __BEOS__ // get a partition info - if (!noPartition && strncmp("/raw", fileName + strlen(fileName) - 4, 4)) { + if (!noPartition + && strlen(fileName) >= 3 + && strncmp("raw", fileName + strlen(fileName) - 3, 3)) { partition_info partitionInfo; if (ioctl(fd, B_GET_PARTITION_INFO, &partitionInfo) == 0) { partitionOffset = partitionInfo.offset;