From: Matthew Fernandez Date: Wed, 2 Nov 2022 01:27:08 +0000 (-0700) Subject: smyrna: remove unnecessary symbol lookup on Windows X-Git-Tag: 7.0.1~6^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=954c0096cecbfc9b867b8b139c505bae41b4c7b0;p=graphviz smyrna: remove unnecessary symbol lookup on Windows The `GetModuleFileName` API accepts a null pointer as the first argument to mean the current executable. --- diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index 0c76ac46b..d6c045819 100644 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -182,13 +182,8 @@ int main(int argc, char *argv[]) int r; char line[BSZ]; char* s; - MEMORY_BASIC_INFORMATION mbi; - if (VirtualQuery (&main, &mbi, sizeof(mbi)) == 0) { - fprintf (stderr,"failed to get handle for executable.\n"); - graphviz_exit(1); - } - r = GetModuleFileName ((HMODULE)mbi.AllocationBase, line, BSZ); + r = GetModuleFileName(NULL, line, BSZ); if (!r || (r == BSZ)) { fprintf (stderr,"failed to get path for executable.\n"); graphviz_exit(1);