[PATCH] fixed if check before strchr

Eric Pouech eric.pouech at orange.fr
Tue May 6 15:00:38 CDT 2008


Marcus Meissner a écrit :
> Hi,
>
> spotted by Coverity (CID 701), a if (!spath) should be if (spath).
>
> Ciao, Marcus
> ---
>  programs/winedbg/source.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/programs/winedbg/source.c b/programs/winedbg/source.c
> index 5519c57..1db7092 100644
> --- a/programs/winedbg/source.c
> +++ b/programs/winedbg/source.c
> @@ -128,7 +128,7 @@ static BOOL     source_locate_file(const char* srcfile, char* path)
>          while (!found)
>          {
>              spath = strchr(spath, '\\');
> -            if (!spath) spath = strchr(spath, '/');
> +            if (spath) spath = strchr(spath, '/');
>              if (!spath) break;
>              spath++;
>              found = SearchPathA(dbg_curr_process->search_path, spath, NULL, MAX_PATH, path, NULL);
>   
actually no
the code intends to find the first occurence of / or \
A+

-- 
Eric Pouech
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)





More information about the wine-patches mailing list