diff options
author | Peter Pentchev <roam@ringlet.net> | 2015-04-28 13:28:28 +0300 |
---|---|---|
committer | Peter Pentchev <roam@ringlet.net> | 2015-05-15 11:37:55 +0300 |
commit | 49db2eaf4460c9e2d1e18f0c7918238d855192c2 (patch) | |
tree | d6413f09ce1c4b202f151e818e25e0f33e5ed58c /debian/patches | |
parent | a4565963bb102249d2224ef5ac8f274000e783a1 (diff) |
Fix some cppcheck warnings.
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/20-comparison.patch | 16 | ||||
-rw-r--r-- | debian/patches/21-arg-null.patch | 17 | ||||
-rw-r--r-- | debian/patches/series | 2 |
3 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/20-comparison.patch b/debian/patches/20-comparison.patch new file mode 100644 index 0000000..6187537 --- /dev/null +++ b/debian/patches/20-comparison.patch @@ -0,0 +1,16 @@ +Description: Fix a log level check to not be always true. +Forwarded: not yet +Author: Peter Pentchev <roam@ringlet.net> +Last-Update: 2015-04-27 + +--- a/src/log.c ++++ b/src/log.c +@@ -215,7 +215,7 @@ + file_putline(outfile, line); /* send log to file */ + } + } else if(mode==LOG_MODE_ERROR) { +- if(level>=0 || level<=7) /* just in case */ ++ if(level>=0 && level<=7) /* just in case */ + line=str_printf("[%c] %s", "***!:. "[level], text); + else + line=str_printf("[?] %s", text); diff --git a/debian/patches/21-arg-null.patch b/debian/patches/21-arg-null.patch new file mode 100644 index 0000000..48b9290 --- /dev/null +++ b/debian/patches/21-arg-null.patch @@ -0,0 +1,17 @@ +Description: Remove a redundant null pointer check. +Forwarded: not yet +Author: Peter Pentchev <roam@ringlet.net> +Last-Update: 2015-04-27 + +--- a/src/sthreads.c ++++ b/src/sthreads.c +@@ -433,8 +433,7 @@ + s_log(LOG_DEBUG, "Creating a new thread"); + if((long)_beginthread((void(*)(void *))cli, arg->opt->stack_size, arg)==-1) { + ioerror("_beginthread"); +- if(arg) +- str_free(arg); ++ str_free(arg); + if(s>=0) + closesocket(s); + return -1; diff --git a/debian/patches/series b/debian/patches/series index 7b6ad05..9c3f4fb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,3 +10,5 @@ 17-upstream-hangup.patch 18-lsb-startup.patch 19-typos.patch +20-comparison.patch +21-arg-null.patch |