for (size_t i = 0; i < p; i++)
memcpy(buf + 3 * i, "\b \b", 3);
- return loop_write(ttyfd, buf, 3*p, false);
+ return loop_write(ttyfd, buf, 3 * p);
}
static int backspace_string(int ttyfd, const char *str) {
if (!packet)
return -ENOMEM;
- r = loop_write(fd, packet, n + 1, true);
+ r = loop_write_full(fd, packet, n + 1, USEC_INFINITY);
if (r < 0)
return r;
if (asprintf(&packet, "*\002%c%s%n", (int) (strlen(message) + 1), message, &n) < 0)
return -ENOMEM;
- r = loop_write(fd, packet, n+1, true);
+ r = loop_write_full(fd, packet, n + 1, USEC_INFINITY);
if (r < 0)
return r;
use_color = colors_enabled();
if (use_color)
- (void) loop_write(ttyfd, ANSI_HIGHLIGHT, SIZE_MAX, false);
+ (void) loop_write(ttyfd, ANSI_HIGHLIGHT, SIZE_MAX);
- (void) loop_write(ttyfd, message, SIZE_MAX, false);
- (void) loop_write(ttyfd, " ", 1, false);
+ (void) loop_write(ttyfd, message, SIZE_MAX);
+ (void) loop_write(ttyfd, " ", 1);
if (!FLAGS_SET(flags, ASK_PASSWORD_SILENT) && !FLAGS_SET(flags, ASK_PASSWORD_ECHO)) {
if (use_color)
- (void) loop_write(ttyfd, ansi_grey(), SIZE_MAX, false);
- (void) loop_write(ttyfd, PRESS_TAB, SIZE_MAX, false);
+ (void) loop_write(ttyfd, ansi_grey(), SIZE_MAX);
+
+ (void) loop_write(ttyfd, PRESS_TAB, SIZE_MAX);
press_tab_visible = true;
}
if (use_color)
- (void) loop_write(ttyfd, ANSI_NORMAL, SIZE_MAX, false);
+ (void) loop_write(ttyfd, ANSI_NORMAL, SIZE_MAX);
new_termios = old_termios;
new_termios.c_lflag &= ~(ICANON|ECHO);
if (c == 4) { /* C-d also known as EOT */
if (ttyfd >= 0)
- (void) loop_write(ttyfd, SKIPPED, SIZE_MAX, false);
+ (void) loop_write(ttyfd, SKIPPED, SIZE_MAX);
goto skipped;
}
* first key (and only as first key), or ... */
if (ttyfd >= 0)
- (void) loop_write(ttyfd, NO_ECHO, SIZE_MAX, false);
+ (void) loop_write(ttyfd, NO_ECHO, SIZE_MAX);
} else if (ttyfd >= 0)
- (void) loop_write(ttyfd, "\a", 1, false);
+ (void) loop_write(ttyfd, "\a", 1);
} else if (c == '\t' && !FLAGS_SET(flags, ASK_PASSWORD_SILENT)) {
/* ... or by pressing TAB at any time. */
if (ttyfd >= 0)
- (void) loop_write(ttyfd, NO_ECHO, SIZE_MAX, false);
+ (void) loop_write(ttyfd, NO_ECHO, SIZE_MAX);
} else if (p >= sizeof(passphrase)-1) {
/* Reached the size limit */
if (ttyfd >= 0)
- (void) loop_write(ttyfd, "\a", 1, false);
+ (void) loop_write(ttyfd, "\a", 1);
} else {
passphrase[p++] = c;
n = utf8_encoded_valid_unichar(passphrase + codepoint, SIZE_MAX);
if (n >= 0) {
if (FLAGS_SET(flags, ASK_PASSWORD_ECHO))
- (void) loop_write(ttyfd, passphrase + codepoint, n, false);
+ (void) loop_write(ttyfd, passphrase + codepoint, n);
else
- (void) loop_write(
- ttyfd,
- special_glyph(SPECIAL_GLYPH_BULLET),
- SIZE_MAX,
- false);
+ (void) loop_write(ttyfd,
+ special_glyph(SPECIAL_GLYPH_BULLET),
+ SIZE_MAX);
codepoint = p;
}
}
finish:
if (ttyfd >= 0 && reset_tty) {
- (void) loop_write(ttyfd, "\n", 1, false);
+ (void) loop_write(ttyfd, "\n", 1);
(void) tcsetattr(ttyfd, TCSADRAIN, &old_termios);
}