summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fontfile/fontdir.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fontfile/fontdir.c b/src/fontfile/fontdir.c
index c63a245..a9bf667 100644
--- a/src/fontfile/fontdir.c
+++ b/src/fontfile/fontdir.c
@@ -112,11 +112,12 @@ FontFileMakeDir(const char *dirName, int size)
const char *attrib;
int attriblen;
-#if !defined(WIN32)
attrib = strchr(dirName, ':');
-#else
- /* WIN32 uses the colon in the drive letter descriptor, skip this */
- attrib = strchr(dirName+2, ':');
+#if defined(WIN32)
+ if (attrib && attrib - dirName == 1) {
+ /* WIN32 uses the colon in the drive letter descriptor, skip this */
+ attrib = strchr(dirName + 2, ':');
+ }
#endif
if (attrib) {
dirlen = attrib - dirName;