X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=amandad-src%2Famandad_util.c;h=7444c5ea3e051dd5553900d2abfbbaa5f5416ae6;hb=94a044f90357edefa6f4ae9f0b1d5885b0e34aee;hp=9ce31fdebddaeb3dc5ac68228b3befff300a1d63;hpb=d3b2175e084f88c8736ad7073eacbf4670147aec;p=debian%2Famanda diff --git a/amandad-src/amandad_util.c b/amandad-src/amandad_util.c index 9ce31fd..7444c5e 100644 --- a/amandad-src/amandad_util.c +++ b/amandad-src/amandad_util.c @@ -65,46 +65,41 @@ parse_g_options( while (tok != NULL) { if(strncmp(tok,"features=", 9) == 0) { if(g_options->features != NULL) { - dbprintf(("%s: multiple features option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple features option\n")); if(verbose) { - printf("ERROR [multiple features option]\n"); + g_printf(_("ERROR [multiple features option]\n")); } } if((g_options->features = am_string_to_feature(tok+9)) == NULL) { - dbprintf(("%s: bad features value \"%s\n", - debug_prefix_time(NULL), tok+10)); + dbprintf(_("bad features value \"%s\"\n"), tok+10); if(verbose) { - printf("ERROR [bad features value \"%s\"]\n", tok+10); + g_printf(_("ERROR [bad features value \"%s\"]\n"), tok+10); } } } else if(strncmp(tok,"hostname=", 9) == 0) { if(g_options->hostname != NULL) { - dbprintf(("%s: multiple hostname option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple hostname option\n")); if(verbose) { - printf("ERROR [multiple hostname option]\n"); + g_printf(_("ERROR [multiple hostname option]\n")); } } g_options->hostname = stralloc(tok+9); } else if(strncmp(tok,"auth=", 5) == 0) { if(g_options->auth != NULL) { - dbprintf(("%s: multiple auth option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple auth option\n")); if(verbose) { - printf("ERROR [multiple auth option]\n"); + g_printf(_("ERROR [multiple auth option]\n")); } } g_options->auth = stralloc(tok+5); } else if(strncmp(tok,"maxdumps=", 9) == 0) { if(g_options->maxdumps != 0) { - dbprintf(("%s: multiple maxdumps option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple maxdumps option\n")); if(verbose) { - printf("ERROR [multiple maxdumps option]\n"); + g_printf(_("ERROR [multiple maxdumps option]\n")); } } if(sscanf(tok+9, "%d;", &new_maxdumps) == 1) { @@ -115,46 +110,41 @@ parse_g_options( g_options->maxdumps = new_maxdumps; } else { - dbprintf(("%s: bad maxdumps value \"%s\"\n", - debug_prefix_time(NULL), tok+9)); + dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9); if(verbose) { - printf("ERROR [bad maxdumps value \"%s\"]\n", + g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"), tok+9); } } } else { - dbprintf(("%s: bad maxdumps value \"%s\"\n", - debug_prefix_time(NULL), tok+9)); + dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9); if(verbose) { - printf("ERROR [bad maxdumps value \"%s\"]\n", + g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"), tok+9); } } } else if(strncmp(tok,"config=", 7) == 0) { if(g_options->config != NULL) { - dbprintf(("%s: multiple config option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple config option\n")); if(verbose) { - printf("ERROR [multiple config option]\n"); + g_printf(_("ERROR [multiple config option]\n")); } } g_options->config = stralloc(tok+7); if (strchr(g_options->config, '/')) { amfree(g_options->config); - dbprintf(("%s: invalid character in config option\n", - debug_prefix_time(NULL))); + dbprintf(_("invalid character in config option\n")); if(verbose) { - printf("ERROR [invalid character in config option]\n"); + g_printf(_("ERROR [invalid character in config option]\n")); } } } else { - dbprintf(("%s: unknown option \"%s\"\n", - debug_prefix_time(NULL), tok)); + dbprintf(_("unknown option \"%s\"\n"), tok); if(verbose) { - printf("ERROR [unknown option \"%s\"]\n", tok); + g_printf(_("ERROR [unknown option \"%s\"]\n"), tok); } } tok = strtok(NULL, ";"); @@ -172,10 +162,12 @@ void free_g_options( g_option_t * g_options) { - amfree(g_options->str); - am_release_feature_set(g_options->features); - amfree(g_options->hostname); - amfree(g_options->auth); - amfree(g_options->config); - amfree(g_options); + if (g_options != NULL) { + amfree(g_options->str); + am_release_feature_set(g_options->features); + amfree(g_options->hostname); + amfree(g_options->auth); + amfree(g_options->config); + amfree(g_options); + } }