From dae776fb339c4dbeb5d6cb1b5a533f2dddfa34b4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 28 Sep 2014 18:47:08 +0100 Subject: [PATCH] [Refs #87: Static Analysis] Be explicit about checking pointer --- pdblocate/pdblocate.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pdblocate/pdblocate.cpp b/pdblocate/pdblocate.cpp index 6644397f2..286e0e718 100644 --- a/pdblocate/pdblocate.cpp +++ b/pdblocate/pdblocate.cpp @@ -541,12 +541,13 @@ AddrInfo GetAddr(wstring req) { wcsncpy_s(ret.funcName, file, 126); + wchar_t *voidparam = wcsstr(ret.funcName, L"(void)"); + // remove stupid (void) for empty parameters - if(wcsstr(ret.funcName, L"(void)")) + if (voidparam != NULL) { - wchar_t *a = wcsstr(ret.funcName, L"(void)"); - *(a+1) = L')'; - *(a+2) = 0; + *(voidparam + 1) = L')'; + *(voidparam + 2) = 0; } }