Преглед изворни кода

Strip leading spaces on dns return value (689563 - Simon L Nielsen)

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@350 f882894a-f735-0410-b71e-b25c423dba1c
Ton Voon пре 23 година
родитељ
комит
782bc207d5
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      plugins/check_dns.c

+ 5 - 1
plugins/check_dns.c

@@ -132,7 +132,11 @@ main (int argc, char **argv)
 				printf ("%s\n", input_buffer);
 				printf ("%s\n", input_buffer);
 
 
 			if ((temp_buffer = index (input_buffer, ':'))) {
 			if ((temp_buffer = index (input_buffer, ':'))) {
-				address = strscpy (address, temp_buffer + 2);
+				temp_buffer++;
+				/* Strip leading spaces */
+				for (; *temp_buffer != '\0' && *temp_buffer == ' '; temp_buffer++)
+					/* NOOP */;
+				address = strscpy (address, temp_buffer);
 				strip (address);
 				strip (address);
 				result = STATE_OK;
 				result = STATE_OK;
 			}
 			}