Fix bug introduced in last commit: jitter and stratum must be initialized at the begining (and /me must have some rest now).

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/dermoth_ntp_rework@1836 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
Thomas Guyot-Sionnest 2007-11-26 10:34:43 +00:00
parent ef1863eed9
commit ef1f4e1e69

View file

@ -234,6 +234,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
status = STATE_OK;
*offset_result = STATE_UNKNOWN;
*jitter = *stratum = -1;
/* Long-winded explanation:
* Getting the sync peer offset, jitter and stratum requires a number of
@ -576,7 +577,7 @@ int main(int argc, char *argv[]){
break;
}
if(!syncsource_found)
asprintf(&result_line, "%s %s, ", result_line, _("Server not synchronized"));
asprintf(&result_line, "%s %s,", result_line, _("Server not synchronized"));
if(offset_result == STATE_UNKNOWN){
asprintf(&result_line, "%s %s", result_line, _("Offset unknown"));