0
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-07-26 12:14:28 -04:00

Moved string termination out of main loop

This commit is contained in:
James Booth 2015-01-15 01:27:24 +00:00
parent aec1484806
commit 40f91de7a3
2 changed files with 4 additions and 1 deletions

View File

@ -116,7 +116,6 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
ui_update(); ui_update();
} }
inp[size++] = '\0';
cmd_result = process_input(inp); cmd_result = process_input(inp);
} }
} }

View File

@ -193,6 +193,10 @@ ui_get_char(char *input, int *size)
ui_input_nonblocking(FALSE); ui_input_nonblocking(FALSE);
} }
if (ch == '\n') {
input[*size++] = '\0';
}
return (ch != '\n'); return (ch != '\n');
} }