From c8711464bb86c5339cee37b41ff193f165722e73 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 28 Jul 2020 11:46:30 +0200 Subject: [PATCH] api: fix trailing number detection in RemoveNumberedSuffix() Signed-off-by: Simon Rozman --- api/devmgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/devmgmt.c b/api/devmgmt.c index 6454979..0022d56 100644 --- a/api/devmgmt.c +++ b/api/devmgmt.c @@ -336,7 +336,7 @@ static void RemoveNumberedSuffix(_In_z_ const WCHAR *Name, _Out_ WCHAR *Removed) { size_t Len = wcslen(Name); - if (Len && Name[Len - 1] < L'0' || Name[Len - 1] > L'9') + if (Len && (Name[Len - 1] < L'0' || Name[Len - 1] > L'9')) { wmemcpy(Removed, Name, Len + 1); return;