summaryrefslogtreecommitdiffstats
path: root/src/tools/tools_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tools_util.c')
-rw-r--r--src/tools/tools_util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index 731b2d04f..85164c612 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -70,8 +70,20 @@ static int setup_db(struct tools_ctx *ctx)
*/
void usage(poptContext pc, const char *error)
{
+ size_t lentmp;
+ char nl[2] = "";
+
poptPrintUsage(pc, stderr, 0);
- if (error) fprintf(stderr, "%s", error);
+
+ if (error) {
+ lentmp = strlen(error);
+ if ((lentmp > 0) && (error[lentmp - 1] != '\n')) {
+ nl[0]='\n';
+ nl[1]='\0';
+ }
+
+ fprintf(stderr, "%s%s", error, nl);
+ }
}
int parse_groups(TALLOC_CTX *mem_ctx, const char *optstr, char ***_out)