From 6ae12d0b8543934a320887729f9e82aa1a56865b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 22 Apr 2021 10:13:09 -0700 Subject: Avoid over-long lines --- core/helpers.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/helpers.cpp') diff --git a/core/helpers.cpp b/core/helpers.cpp index c03c3b62..a2f1a6c9 100644 --- a/core/helpers.cpp +++ b/core/helpers.cpp @@ -40,9 +40,12 @@ const PathNamePair &GetProcBinary() if(procbin) return *procbin; auto fullpath = al::vector(256); - DWORD len; - while((len=GetModuleFileNameW(nullptr, fullpath.data(), static_cast(fullpath.size()))) == fullpath.size()) + DWORD len{GetModuleFileNameW(nullptr, fullpath.data(), static_cast(fullpath.size()))}; + while(len == fullpath.size()) + { fullpath.resize(fullpath.size() << 1); + len = GetModuleFileNameW(nullptr, fullpath.data(), static_cast(fullpath.size())); + } if(len == 0) { ERR("Failed to get process name: error %lu\n", GetLastError()); -- cgit v1.2.3