mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-24 07:39:14 -04:00
check_ssh: Put variable in the correct scope
This commit is contained in:
parent
3c53bf623d
commit
a69dff1522
1 changed files with 1 additions and 2 deletions
|
|
@ -255,12 +255,11 @@ int ssh_connect(mp_check *overall, char *haddr, int hport, char *desired_remote_
|
|||
byte_offset = 0;
|
||||
|
||||
char *index = NULL;
|
||||
size_t len = 0;
|
||||
while ((index = strchr(output + byte_offset, '\n')) != NULL) {
|
||||
/*Partition the buffer so that this line is a separate string,
|
||||
* by replacing the newline with NUL*/
|
||||
output[(index - output)] = '\0';
|
||||
len = strlen(output + byte_offset);
|
||||
size_t len = strlen(output + byte_offset);
|
||||
|
||||
if ((len >= 4) && (strncmp(output + byte_offset, "SSH-", 4) == 0)) {
|
||||
/*if the string starts with SSH-, this _should_ be a valid version control string*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue