From 954c0096cecbfc9b867b8b139c505bae41b4c7b0 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 1 Nov 2022 18:27:08 -0700 Subject: [PATCH] smyrna: remove unnecessary symbol lookup on Windows The `GetModuleFileName` API accepts a null pointer as the first argument to mean the current executable. --- cmd/smyrna/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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); -- 2.50.1