[PATCH] winetest: check strchr result (Coverity)
Marcus Meissner
marcus at jet.franken.de
Sun Sep 20 11:46:25 CDT 2009
Might not become NULL ever, but who knows.
Ciao, Marcus
---
programs/winetest/main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 4287066..fdff580 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -599,10 +599,12 @@ static HMODULE load_com_dll(const char *name)
static void get_dll_path(HMODULE dll, char **path, char *filename)
{
char dllpath[MAX_PATH];
+ char *s;
GetModuleFileNameA(dll, dllpath, MAX_PATH);
strcpy(filename, dllpath);
- *strrchr(dllpath, '\\') = '\0';
+ s = strrchr(dllpath, '\\');
+ if (s) *s='\0';
*path = heap_strdup( dllpath );
}
--
1.5.6
More information about the wine-patches
mailing list