diff --git a/src/fs/ntapi_tt_open_physical_parent_directory.c b/src/fs/ntapi_tt_open_physical_parent_directory.c index a9975a7..e80a21a 100644 --- a/src/fs/ntapi_tt_open_physical_parent_directory.c +++ b/src/fs/ntapi_tt_open_physical_parent_directory.c @@ -39,9 +39,11 @@ int32_t __stdcall __ntapi_tt_open_physical_parent_directory( return NT_STATUS_BAD_FILE_TYPE; wch = path->buffer + (path->strlen / sizeof(uint16_t)); - while ((--wch >= path->buffer) && (*wch != '\\')); - if (wch == path->buffer ) + for (; (wch > path->buffer) && (wch[-1] != '\\'); wch--) + (void)0; + + if (wch == path->buffer) return NT_STATUS_MORE_PROCESSING_REQUIRED; path->strlen = sizeof(uint16_t) * (uint16_t)(wch-path->buffer);