From caa8bd6423e2d0d1b4e72c150e80b9c6a9e1b7fe Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 19 Nov 2008 06:45:18 +0000 Subject: Bulk EOL cleanup $ git diff --ignore-space-change|diffstat 0 files changed git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 5732175..c19952d 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c @@ -82,7 +82,7 @@ static void parse_locator(const char *locator, const char *def_stanza, np_ini_in } else { i->file=strdup(&(locator[stanza_len+1])); } - + if(i->file==NULL || i->stanza==NULL){ die(STATE_UNKNOWN, _("malloc() failed!\n")); } @@ -110,7 +110,7 @@ np_arg_list* np_get_defaults(const char *locator, const char *default_section){ if(inifile!=stdin) fclose(inifile); } free(i.stanza); - return defaults; + return defaults; } /* read_defaults is where the meat of the parsing takes place. @@ -161,7 +161,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){ default: switch(stanzastate){ /* we never found the start of the first stanza, so - * we're dealing with a config error + * we're dealing with a config error */ case NOSTANZA: die(STATE_UNKNOWN, _("Config file error")); diff --git a/lib/utils_base.c b/lib/utils_base.c index d1453c6..68f4567 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -89,7 +89,7 @@ range set_range_end(temp_range, end); } - if (temp_range->start_infinity == TRUE || + if (temp_range->start_infinity == TRUE || temp_range->end_infinity == TRUE || temp_range->start <= temp_range->end) { return temp_range; @@ -164,7 +164,7 @@ check_range(double value, range *my_range) { int no = FALSE; int yes = TRUE; - + if (my_range->alert_on == INSIDE) { no = TRUE; yes = FALSE; diff --git a/lib/utils_disk.c b/lib/utils_disk.c index 3ce4d47..ba2b21d 100644 --- a/lib/utils_disk.c +++ b/lib/utils_disk.c @@ -91,7 +91,7 @@ np_del_parameter(struct parameter_list *item, struct parameter_list *prev) return next; } - + /* returns a pointer to the struct found in the list */ struct parameter_list * np_find_parameter(struct parameter_list *list, const char *name) @@ -101,7 +101,7 @@ np_find_parameter(struct parameter_list *list, const char *name) if (! strcmp(temp_list->name, name)) return temp_list; } - + return NULL; } @@ -126,7 +126,7 @@ np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list if (! best_match) { for (me = mount_list; me; me = me->me_next) { size_t len = strlen (me->me_mountdir); - if ((exact == FALSE && (best_match_len <= len && len <= name_len && + if ((exact == FALSE && (best_match_len <= len && len <= name_len && (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0))) || (exact == TRUE && strcmp(me->me_mountdir, d->name)==0)) { @@ -175,7 +175,7 @@ np_seen_name(struct name_list *list, const char *name) } int -np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) +np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) { if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 || regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) { diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index 5781f75..35874a9 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -79,8 +79,8 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #elif defined(__sun__) || defined(__solaris__) || defined(__hpux__) -#define INSAP 22 -#define OUTSAP 24 +#define INSAP 22 +#define OUTSAP 24 #include #include @@ -90,17 +90,17 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #define bcopy(source, destination, length) memcpy(destination, source, length) -#define AREA_SZ 5000 /* buffer length in bytes */ +#define AREA_SZ 5000 /* buffer length in bytes */ static u_long ctl_area[AREA_SZ]; static u_long dat_area[AREA_SZ]; static struct strbuf ctl = {AREA_SZ, 0, (char *)ctl_area}; static struct strbuf dat = {AREA_SZ, 0, (char *)dat_area}; -#define GOT_CTRL 1 -#define GOT_DATA 2 -#define GOT_BOTH 3 -#define GOT_INTR 4 -#define GOT_ERR 128 +#define GOT_CTRL 1 +#define GOT_DATA 2 +#define GOT_BOTH 3 +#define GOT_INTR 4 +#define GOT_ERR 128 #define u_int8_t uint8_t #define u_int16_t uint16_t @@ -222,7 +222,7 @@ dhcp_offer *dhcp_offer_list=NULL; requested_server *requested_server_list=NULL; int valid_responses=0; /* number of valid DHCPOFFERs we received */ -int requested_servers=0; +int requested_servers=0; int requested_responses=0; int request_specific_address=FALSE; @@ -382,7 +382,7 @@ int get_hardware_address(int sock,char *interface_name){ unit = atoi(p) ; *p = '\0' ; strncat(dev, interface_name, 6) ; - } + } else{ printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name); exit(STATE_UNKNOWN); @@ -535,7 +535,7 @@ int send_dhcp_discover(int sock){ /* send the DHCPDISCOVER packet out */ send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast); - if(verbose) + if(verbose) printf("\n\n"); return OK; @@ -564,7 +564,7 @@ int get_dhcp_offer(int sock){ if((current_time-start_time)>=dhcpoffer_timeout) break; - if(verbose) + if(verbose) printf("\n\n"); bzero(&source,sizeof(source)); @@ -581,7 +581,7 @@ int get_dhcp_offer(int sock){ continue; } else{ - if(verbose) + if(verbose) printf(_("Result=OK\n")); responses++; @@ -626,7 +626,7 @@ int get_dhcp_offer(int sock){ printf("\n"); if(result==ERROR){ - if(verbose) + if(verbose) printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n")); continue; @@ -660,7 +660,7 @@ int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest)); - if(verbose) + if(verbose) printf(_("send_dhcp_packet result: %d\n"),result); if(result<0) @@ -853,7 +853,7 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){ /* get option length */ option_length=offer_packet->options[x++]; - if(verbose) + if(verbose) printf("Option: %d (0x%02X)\n",option_type,option_length); /* get option data */ @@ -989,7 +989,7 @@ int get_results(void){ if(verbose){ printf(_("DHCP Server Match: Offerer=%s"),inet_ntoa(temp_offer->server_address)); printf(_(" Requested=%s"),inet_ntoa(temp_server->server_address)); - if(temp_server->answered) + if(temp_server->answered) printf(_(" (duplicate)")); printf(_("\n")); } @@ -1090,7 +1090,7 @@ int call_getopt(int argc, char **argv){ int option_index = 0; static struct option long_options[] = - { + { {"serverip", required_argument,0,'s'}, {"requestedip", required_argument,0,'r'}, {"timeout", required_argument,0,'t'}, @@ -1306,7 +1306,7 @@ static int dl_bind(int fd, int sap, u_char *addr){ /*********************************************************************** * interface: - * function mac_addr_dlpi - get the mac address of the interface with + * function mac_addr_dlpi - get the mac address of the interface with * type dev (eg lnc, hme) and unit (0, 1 ..) * * parameter: addr: an array of six bytes, has to be allocated by the caller diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index ff6c73b..cc3f3d5 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1313,7 +1313,7 @@ print_help(void) printf (" %s",_("timeout value (seconds, currently ")); printf ("%u)\n", timeout); printf (" %s\n", "-b"); - printf (" %s\n", _("Number of icmp data bytes to send")); + printf (" %s\n", _("Number of icmp data bytes to send")); printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); printf (" %s\n", "-v"); printf (" %s\n", _("verbose")); diff --git a/plugins-root/pst3.c b/plugins-root/pst3.c index b275a6b..8513656 100644 --- a/plugins-root/pst3.c +++ b/plugins-root/pst3.c @@ -8,7 +8,7 @@ * Description: * * This file contains the pst3 executable. This is a replacement ps command -* for Solaris to get output which provides a long argument listing, which +* for Solaris to get output which provides a long argument listing, which * is not possible with the standard ps command (due to truncation). /usr/ucb/ps * also has issues where some fields run into each other. * @@ -17,7 +17,7 @@ * * Originally written by R.W.Ingraham * Rewritten by Duncan Ferguson (Altinity Ltd, June 2008) -* The rewrite was necessary as /dev/kmem is not available within +* The rewrite was necessary as /dev/kmem is not available within * non-global zones on Solaris 10 * * Details for rewrite came from @@ -48,7 +48,7 @@ #include #include #include -#include +#include /* * Constants @@ -125,8 +125,8 @@ int main (int argc, char **argv) char *procname; char *ptr; int argslen; - uintptr_t args_addr;; - uintptr_t *args_vecs;; + uintptr_t args_addr;; + uintptr_t *args_vecs;; int args_count; if(proc->d_name[0] == '.') @@ -146,8 +146,8 @@ try_again: close(ps_fd); close(as_fd); if(err == EAGAIN) goto try_again; - if(err != ENOENT) - fprintf(stderr, "%s: read() on %s: %s\n", szProg, + if(err != ENOENT) + fprintf(stderr, "%s: read() on %s: %s\n", szProg, ps_name, strerror(err)); continue; } @@ -185,7 +185,7 @@ try_again: ); free(procname); - /* + /* * and now for the command line stuff */ @@ -195,18 +195,18 @@ try_again: if(psinfo.pr_dmodel == PR_MODEL_NATIVE) { /* this process matches target process */ - pread(as_fd,args_vecs, args_count * sizeof(uintptr_t), + pread(as_fd,args_vecs, args_count * sizeof(uintptr_t), args_addr); - } else { + } else { /* this process is 64bit, target process is 32 bit*/ caddr32_t *args_vecs32 = (caddr32_t *)args_vecs; - pread(as_fd,args_vecs32,args_count * sizeof(caddr32_t), + pread(as_fd,args_vecs32,args_count * sizeof(caddr32_t), args_addr); for (i=args_count-1;i>=0;--i) args_vecs[i]=args_vecs32[i]; } - /* + /* * now read in the args - if what we read in fills buffer * resize buffer and reread that bit again */ diff --git a/plugins/check_apt.c b/plugins/check_apt.c index 440755d..49a7c4f 100644 --- a/plugins/check_apt.c +++ b/plugins/check_apt.c @@ -116,7 +116,7 @@ int main (int argc, char **argv) { result = max_state(result, STATE_OK); } - printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), + printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), state_text(result), packages_available, (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade", @@ -305,7 +305,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ } regfree(&ireg); regfree(&sreg); - if(do_exclude!=NULL) regfree(&ereg); + if(do_exclude!=NULL) regfree(&ereg); free(cmdline); return result; } @@ -364,7 +364,7 @@ char* add_to_regexp(char *expr, const char *next){ sprintf((char*)(re+strlen(re)-2), "|%s) ", next); } - return re; + return re; } char* construct_cmdline(upgrade_type u, const char *opts){ diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c index d493149..04919e0 100644 --- a/plugins/check_cluster.c +++ b/plugins/check_cluster.c @@ -124,7 +124,7 @@ int main(int argc, char **argv){ } } } - + /* return the status of the cluster */ if(check_type==CHECK_SERVICES){ @@ -149,7 +149,7 @@ int main(int argc, char **argv){ int process_arguments(int argc, char **argv){ int c; int option=0; - static struct option longopts[]={ + static struct option longopts[]={ {"data", required_argument,0,'d'}, {"warning", required_argument,0,'w'}, {"critical", required_argument,0,'c'}, diff --git a/plugins/check_disk.c b/plugins/check_disk.c index f0950c9..3caf4a1 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -198,7 +198,7 @@ main (int argc, char **argv) /* If a list of paths has not been selected, find entire mount list and create list of paths */ - if (path_selected == FALSE) { + if (path_selected == FALSE) { for (me = mount_list; me; me = me->me_next) { if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) { path = np_add_parameter(&path_select_list, me->me_mountdir); @@ -293,8 +293,8 @@ main (int argc, char **argv) /* Skip excluded fstypes */ } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { continue; - /* Skip excluded fs's */ - } else if (dp_exclude_list && + /* Skip excluded fs's */ + } else if (dp_exclude_list && (np_find_name (dp_exclude_list, me->me_devname) || np_find_name (dp_exclude_list, me->me_mountdir))) { continue; @@ -327,7 +327,7 @@ main (int argc, char **argv) dfree_inodes_percent = 100 - dused_inodes_percent; if (verbose >= 3) { - printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", + printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult); } @@ -430,7 +430,7 @@ double calculate_percent(uintmax_t value, uintmax_t total) { double pct = -1; /* I don't understand the below, but it is taken from coreutils' df */ /* Seems to be calculating pct, in the best possible way */ - if (value <= TYPE_MAXIMUM(uintmax_t) / 100 + if (value <= TYPE_MAXIMUM(uintmax_t) / 100 && total != 0) { uintmax_t u100 = value * 100; pct = u100 / total + (u100 % total != 0); @@ -546,7 +546,7 @@ process_arguments (int argc, char **argv) } break; - /* Awful mistake where the range values do not make sense. Normally, + /* Awful mistake where the range values do not make sense. Normally, you alert if the value is within the range, but since we are using freespace, we have to alert if outside the range. Thus we artifically force @ at the beginning of the range, so that it is backwards compatible @@ -620,10 +620,10 @@ process_arguments (int argc, char **argv) case 'L': stat_remote_fs = 1; case 'l': - show_local_fs = 1; + show_local_fs = 1; break; case 'p': /* select path */ - if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || + if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { @@ -714,7 +714,7 @@ process_arguments (int argc, char **argv) case 'R': cflags |= REG_ICASE; case 'r': - if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || + if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { @@ -760,7 +760,7 @@ process_arguments (int argc, char **argv) if (path_selected == FALSE) { struct parameter_list *path; for (me = mount_list; me; me = me->me_next) { - if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) + if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) path = np_add_parameter(&path_select_list, me->me_mountdir); path->best_match = me; path->group = group; @@ -819,7 +819,7 @@ process_arguments (int argc, char **argv) void -print_path (const char *mypath) +print_path (const char *mypath) { if (mypath == NULL) printf ("\n"); @@ -829,7 +829,7 @@ print_path (const char *mypath) void -set_all_thresholds (struct parameter_list *path) +set_all_thresholds (struct parameter_list *path) { if (path->freespace_units != NULL) free(path->freespace_units); set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units); diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 19206c2..6bedfef 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -123,7 +123,7 @@ main (int argc, char **argv) /* scan stdout */ for(i = 0; i < chld_out.lines; i++) { - if (addresses == NULL) + if (addresses == NULL) addresses = malloc(sizeof(*addresses)*10); else if (!(n_addresses % 10)) addresses = realloc(addresses,sizeof(*addresses) * (n_addresses + 10)); @@ -289,7 +289,7 @@ error_scan (char *input_buffer) strstr (input_buffer, ": REFUSED"))) die (STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server); - /* Query refused (usually by an ACL in the namserver) */ + /* Query refused (usually by an ACL in the namserver) */ else if (strstr (input_buffer, "Query refused")) die (STATE_CRITICAL, _("Query was refused by DNS server at %s\n"), dns_server); diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c index 372aaff..ff600a7 100644 --- a/plugins/check_dummy.c +++ b/plugins/check_dummy.c @@ -87,7 +87,7 @@ main (int argc, char **argv) return STATE_UNKNOWN; } - if (argc >= 3) + if (argc >= 3) printf (": %s", argv[2]); printf("\n"); diff --git a/plugins/check_game.c b/plugins/check_game.c index 4bc57c8..2a23b74 100644 --- a/plugins/check_game.c +++ b/plugins/check_game.c @@ -105,7 +105,7 @@ main (int argc, char **argv) /* was thinking about running qstat without any options, capturing the -default line, parsing it & making an array of all know server types but thought this would be too much hassle considering this is a tool - for intelligent sysadmins (ha). Could put a static array of known + for intelligent sysadmins (ha). Could put a static array of known server types in a header file but then we'd be limiting ourselves In the end, I figured I'd simply let an error occur & then trap it @@ -139,10 +139,10 @@ main (int argc, char **argv) result = STATE_CRITICAL; } else { - printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", + printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", ret[qstat_game_players], ret[qstat_game_players_max], - ret[qstat_game_field], + ret[qstat_game_field], ret[qstat_map_field], ret[qstat_ping_field], perfdata ("players", atol(ret[qstat_game_players]), "", @@ -345,7 +345,7 @@ print_usage (void) * Test Cases: * * ./check_game --players 7 -p 8 --map 5 qs 67.20.190.61 26000 - * + * * qstat -raw , -qs 67.20.190.61 * ==> QS,67.20.190.61,Nightmare.fintek.ca,67.20.190.61:26000,3,e2m1,6,0,83,0 * diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index 044f08f..c815cc7 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c @@ -123,7 +123,7 @@ main (int argc, char **argv) HPJD_GD_DOOR_OPEN, HPJD_GD_PAPER_OUTPUT, HPJD_GD_STATUS_DISPLAY); /* get the command to run */ - sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, + sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, address, query_string); /* run the command */ @@ -198,7 +198,7 @@ main (int argc, char **argv) strcpy (display_message, temp_buffer + 1); break; default: /* fold multiline message */ - strncat (display_message, input_buffer, + strncat (display_message, input_buffer, sizeof (display_message) - strlen (display_message) - 1); } @@ -218,7 +218,7 @@ main (int argc, char **argv) sprintf (errmsg, "%s", input_buffer ); } - + /* close stderr */ (void) fclose (child_stderr); @@ -232,7 +232,7 @@ main (int argc, char **argv) /* might not be the problem, but most likely is. */ result = STATE_UNKNOWN ; asprintf (&errmsg, "%s : Timeout from host %s\n", errmsg, address ); - + } /* if we had no read errors, check the printer status results... */ @@ -326,7 +326,7 @@ process_arguments (int argc, char **argv) if (argc < 2) return ERROR; - + while (1) { c = getopt_long (argc, argv, "+hVH:C:", longopts, &option); @@ -365,7 +365,7 @@ process_arguments (int argc, char **argv) usage2 (_("Invalid hostname/address"), argv[c]); } } - + if (community == NULL) { if (argv[c] != NULL ) community = argv[c]; diff --git a/plugins/check_http.c b/plugins/check_http.c index 0746741..0d499d9 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -154,7 +154,7 @@ main (int argc, char **argv) usage4 (_("Could not parse arguments")); if (display_html == TRUE) - printf ("", + printf ("", use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); @@ -314,7 +314,7 @@ process_arguments (int argc, char **argv) if (!strcmp (optarg, "critical")) onredirect = STATE_CRITICAL; if (verbose) - printf(_("option f:%d \n"), onredirect); + printf(_("option f:%d \n"), onredirect); break; /* Note: H, I, and u must be malloc'd or will fail on redirects */ case 'H': /* Host Name (virtual host) */ @@ -417,7 +417,7 @@ process_arguments (int argc, char **argv) exit (STATE_WARNING); } else max_page_len = atoi(tmp); - } else + } else min_page_len = atoi (optarg); break; } @@ -556,7 +556,7 @@ parse_time_string (const char *string) if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31) return 0; - /* + /* This is actually wrong: we need to subtract the local timezone offset from GMT from this value. But, that's ok in this usage, because we only comparing these two GMT dates against each other, @@ -990,7 +990,7 @@ check_http (void) elapsed_time = (double)microsec / 1.0e6; die (onredirect, _(" - %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, + status_line, elapsed_time, (display_html ? "" : ""), perfd_time (elapsed_time), perfd_size (pagesize)); } /* end if (http_status >= 300) */ @@ -1006,7 +1006,7 @@ check_http (void) elapsed_time = (double)microsec / 1.0e6; asprintf (&msg, _(" - %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, + status_line, elapsed_time, (display_html ? "" : ""), perfd_time (elapsed_time), perfd_size (pagesize)); if (check_critical_time == TRUE && elapsed_time > critical_time) @@ -1043,9 +1043,9 @@ check_http (void) exit (STATE_OK); } else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) { - if (invert_regex == 0) + if (invert_regex == 0) msg = strdup(_("pattern not found")); - else + else msg = strdup(_("pattern found")); printf (("%s - %s%s|%s %s\n"), _("HTTP CRITICAL"), @@ -1118,7 +1118,7 @@ redir (char *pos, char *status_line) if (i == 0) { pos += (size_t) strcspn (pos, "\r\n"); pos += (size_t) strspn (pos, "\r\n"); - if (strlen(pos) == 0) + if (strlen(pos) == 0) die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), status_line, (display_html ? "" : "")); @@ -1151,7 +1151,7 @@ redir (char *pos, char *status_line) } /* URI_HTTP URI_HOST URI_PATH */ - else if (sscanf (pos, HD2, type, addr, url) == 3 ) { + else if (sscanf (pos, HD2, type, addr, url) == 3 ) { url = prepend_slash (url); use_ssl = server_type_check (type); i = server_port_check (use_ssl); @@ -1181,7 +1181,7 @@ redir (char *pos, char *status_line) i = server_port; strcpy (type, server_type); strcpy (addr, host_name ? host_name : server_address); - } + } else { die (STATE_UNKNOWN, diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 3d6f05c..d0134a0 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -87,15 +87,15 @@ main (int argc, char *argv[]) LDAPMessage *result; /* should be int result = STATE_UNKNOWN; */ - + int status = STATE_UNKNOWN; long microsec; double elapsed_time; - + /* for ldap tls */ - - int tls; - int version=3; + + int tls; + int version=3; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -129,7 +129,7 @@ main (int argc, char *argv[]) printf ("Could not connect to the server at port %i\n", ld_port); return STATE_CRITICAL; } -#else +#else if (!(ld = ldap_open (ld_host, ld_port))) { if (verbose) ldap_perror(ld, "ldap_open"); @@ -137,7 +137,7 @@ main (int argc, char *argv[]) return STATE_CRITICAL; } #endif /* HAVE_LDAP_INIT */ - + #ifdef HAVE_LDAP_SET_OPTION /* set ldap options */ if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) != @@ -152,7 +152,7 @@ main (int argc, char *argv[]) #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) /* ldaps: set option tls */ tls = LDAP_OPT_X_TLS_HARD; - + if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) { if (verbose) @@ -179,7 +179,7 @@ main (int argc, char *argv[]) /* call start_tls */ if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { - if (verbose) + if (verbose) ldap_perror(ld, "ldap_start_tls"); printf (_("Could not init startTLS at port %i!\n"), ld_port); return STATE_CRITICAL; @@ -189,7 +189,7 @@ main (int argc, char *argv[]) return STATE_CRITICAL; #endif /* HAVE_LDAP_START_TLS_S */ } - + /* bind to the ldap server */ if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) { diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c index 62b0cf0..a0bdbeb 100644 --- a/plugins/check_mrtg.c +++ b/plugins/check_mrtg.c @@ -380,7 +380,7 @@ print_help (void) -/* original command line: +/* original command line: