diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp
index 733d2039ceb378b6c262a969e095c411a5982731..93566a6d65b44354bd789f3bd0fadc48c070255f 100644
--- a/src/libs/utils/filesearch.cpp
+++ b/src/libs/utils/filesearch.cpp
@@ -142,9 +142,9 @@ void runFileSearch(QFutureInterface<FileSearchResult> &future,
                     const char *beforeRegion = regionPtr - 1;
                     bool equal = true;
                     if (wholeWord &&
-                            (  isalnum(*beforeRegion)
+                            (  isalnum((unsigned char)*beforeRegion)
                             || (*beforeRegion == '_')
-                            || isalnum(*afterRegion)
+                            || isalnum((unsigned char)*afterRegion)
                             || (*afterRegion == '_'))) {
                         equal = false;
                     }