Skip to content
Snippets Groups Projects
Commit 1bd8392c authored by Stephan Bosch's avatar Stephan Bosch Committed by Timo Sirainen
Browse files

sieve-tools: Reformat sieve-dump.c

parent f656fb29
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,8 @@ int main(int argc, char **argv)
int exit_status = EXIT_SUCCESS;
int c;
sieve_tool = sieve_tool_init("sieve-dump", &argc, &argv, "DhP:x:", FALSE);
sieve_tool = sieve_tool_init("sieve-dump", &argc, &argv,
"DhP:x:", FALSE);
outfile = NULL;
......@@ -62,16 +63,15 @@ int main(int argc, char **argv)
}
}
if ( optind < argc ) {
if (optind < argc) {
binfile = argv[optind++];
} else {
print_help();
i_fatal_status(EX_USAGE, "Missing <script-file> argument");
}
if ( optind < argc ) {
if (optind < argc)
outfile = argv[optind++];
}
/* Finish tool initialization */
svinst = sieve_tool_init_finish(sieve_tool, FALSE, TRUE);
......@@ -81,9 +81,10 @@ int main(int argc, char **argv)
/* Dump binary */
sbin = sieve_load(svinst, binfile, NULL);
if ( sbin != NULL ) {
sieve_tool_dump_binary_to(sbin, outfile == NULL ? "-" : outfile, hexdump);
if (sbin != NULL) {
sieve_tool_dump_binary_to(sbin,
(outfile == NULL ? "-" : outfile),
hexdump);
sieve_close(&sbin);
} else {
i_error("failed to load binary: %s", binfile);
......@@ -91,7 +92,5 @@ int main(int argc, char **argv)
}
sieve_tool_deinit(&sieve_tool);
return exit_status;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.