From 105bb1e742790c2ca9029df656db41dfdd858487 Mon Sep 17 00:00:00 2001 From: Stefan Reitshamer Date: Mon, 29 May 2017 08:42:52 -0400 Subject: [PATCH] prompt for password on stderr instead of stdout --- ArqRestoreCommand.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ArqRestoreCommand.m b/ArqRestoreCommand.m index b7401a8..b9d82d0 100644 --- a/ArqRestoreCommand.m +++ b/ArqRestoreCommand.m @@ -811,8 +811,8 @@ #pragma mark internal - (NSString *)readPasswordWithPrompt:(NSString *)thePrompt error:(NSError **)error { - printf("%s ", [thePrompt UTF8String]); - fflush(stdout); + fprintf(stderr, "%s ", [thePrompt UTF8String]); + fflush(stderr); struct termios oldTermios; struct termios newTermios; @@ -835,7 +835,6 @@ if (len > 0 && buf[len - 1] == '\n') { --len; } - printf("\n"); return [[[NSString alloc] initWithBytes:buf length:len encoding:NSUTF8StringEncoding] autorelease]; }