diff --git a/programs/winedbg/source.c b/programs/winedbg/source.c index c1fb2eb2d82..eb9576d08c0 100644 --- a/programs/winedbg/source.c +++ b/programs/winedbg/source.c @@ -70,9 +70,9 @@ void source_add_path(const char* path) size = strlen(path) + 1; if (search_path) { - unsigned pos = HeapSize(GetProcessHeap(), 0, search_path); + unsigned pos = strlen(search_path) + 1; new = HeapReAlloc(GetProcessHeap(), 0, search_path, pos + size); - if (!new || !pos) return; + if (!new) return; new[pos - 1] = ';'; strcpy(&new[pos], path); }