From 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 20 Jan 2015 04:36:08 +0100 Subject: Minor fixes and tweaks suggested by cppcheck - Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru --- src/common/utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/common/utils.c') diff --git a/src/common/utils.c b/src/common/utils.c index 5ede86296..c168bd74e 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -95,8 +95,9 @@ void ShowDump(const void *buffer, size_t length) { static char* checkpath(char *path, const char *srcpath) { // just make sure the char*path is not const - char *p=path; - if(NULL!=path && NULL!=srcpath) + char *p = path; + if (NULL == path || NULL == srcpath) + return path; while(*srcpath) { if (*srcpath=='/') { *p++ = '\\'; -- cgit v1.2.3-70-g09d2