[monitoring-plugins] check_http: Remove self assignment of a variable ...

RincewindsHat git at monitoring-plugins.org
Sat Dec 30 20:40:13 CET 2023


 Module: monitoring-plugins
 Branch: master
 Commit: ad864430b083d713803725337cf954fdd73f2abd
 Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
   Date: Fri Dec 29 00:45:54 2023 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=ad86443

check_http: Remove self assignment of a variable and add some comments

---

 plugins/check_http.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/check_http.c b/plugins/check_http.c
index 110f118..425ce86 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -472,9 +472,8 @@ bool process_arguments (int argc, char **argv)
       http_method = strdup (optarg);
       char *tmp;
       if ((tmp = strstr(http_method, ":")) != NULL) {
-        tmp[0] = '\0';
-        http_method = http_method;
-        http_method_proxy = ++tmp;
+        tmp[0] = '\0'; // set the ":" in the middle to 0
+        http_method_proxy = ++tmp; // this points to the second part
       }
       break;
     case 'd': /* string or substring */



More information about the Commits mailing list