Code

fixes from richard brodie (tracker id 1216576)
[nagiosplug.git] / plugins / check_dig.c
index a44d578637bd84a6fa2451967e05f879ae18e6c1..4394490e8723ea0fe31c2a0a5d71ca1b0eb022b4 100644 (file)
@@ -54,6 +54,7 @@ main (int argc, char **argv)
        char input_buffer[MAX_INPUT_BUFFER];
        char *command_line;
        char *output;
+       char *t;
        long microsec;
        double elapsed_time;
        int result = STATE_UNKNOWN;
@@ -81,9 +82,9 @@ main (int argc, char **argv)
        if (verbose) {
                printf ("%s\n", command_line);
                if(expected_address != NULL) {
-                       printf ("Looking for: '%s'\n", expected_address);
+                       printf (_("Looking for: '%s'\n"), expected_address);
                } else {
-                       printf ("Looking for: '%s'\n", query_address);
+                       printf (_("Looking for: '%s'\n"), query_address);
                }
        }
 
@@ -124,6 +125,11 @@ main (int argc, char **argv)
                                        result = STATE_OK;
                                }
 
+                               /* Translate output TAB -> SPACE */
+                               t = output;
+                               while ((t = index(t, '\t')) != NULL) 
+                                       *t = ' ';
+
                        } while (!strstr (input_buffer, ";; "));
 
                        if (result == STATE_UNKNOWN) {
@@ -214,9 +220,7 @@ process_arguments (int argc, char **argv)
 
                switch (c) {
                case '?':                                                                       /* help */
-                       printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-                       print_usage ();
-                       exit (STATE_UNKNOWN);
+                       usage2 (_("Unknown argument"), optarg);
                case 'h':                                                                       /* help */
                        print_help ();
                        exit (STATE_OK);
@@ -336,7 +340,7 @@ print_help (void)
 
         printf (_("\
  -a, --expected_address=STRING\n\
-   an address expected to be in the asnwer section.\n\
+   an address expected to be in the answer section.\n\
    if not set, uses whatever was in -l\n"));
 
        printf (_(UT_WARN_CRIT));