summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/common/utils.c
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip
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 <haru@dotalux.com>
Diffstat (limited to 'src/common/utils.c')
-rw-r--r--src/common/utils.c5
1 files changed, 3 insertions, 2 deletions
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++ = '\\';