mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Minor code style cleanups
This commit is contained in:
parent
f96ad43b1f
commit
a5d1546024
1 changed files with 8 additions and 4 deletions
12
src/tty.c
12
src/tty.c
|
|
@ -579,7 +579,8 @@ int tty_connect(void)
|
|||
connected = true;
|
||||
tainted = false;
|
||||
|
||||
if (option.timestamp) next_timestamp = time(NULL);
|
||||
if (option.timestamp)
|
||||
next_timestamp = time(NULL);
|
||||
|
||||
/* Save current port settings */
|
||||
if (tcgetattr(fd, &tio_old) < 0)
|
||||
|
|
@ -633,7 +634,8 @@ int tty_connect(void)
|
|||
rx_total++;
|
||||
|
||||
/* Print timestamp on new line, if desired. */
|
||||
if (next_timestamp && input_char != '\n' && input_char != '\r') {
|
||||
if (next_timestamp && input_char != '\n' && input_char != '\r')
|
||||
{
|
||||
fprintf(stdout, ANSI_COLOR_GRAY "[%s] " ANSI_COLOR_RESET, current_time());
|
||||
next_timestamp = 0;
|
||||
}
|
||||
|
|
@ -643,7 +645,8 @@ int tty_connect(void)
|
|||
{
|
||||
print('\r');
|
||||
print('\n');
|
||||
if (option.timestamp) next_timestamp = time(NULL);
|
||||
if (option.timestamp)
|
||||
next_timestamp = time(NULL);
|
||||
} else
|
||||
{
|
||||
/* Print received tty character to stdout */
|
||||
|
|
@ -657,7 +660,8 @@ int tty_connect(void)
|
|||
|
||||
tainted = true;
|
||||
|
||||
if (input_char == '\n' && option.timestamp) next_timestamp = time(NULL);
|
||||
if (input_char == '\n' && option.timestamp)
|
||||
next_timestamp = time(NULL);
|
||||
} else
|
||||
{
|
||||
/* Error reading - device is likely unplugged */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue