From: jNullj <15849761+jNullj@users.noreply.github.com> Date: Mon, 27 May 2024 16:18:15 +0000 (+0300) Subject: fix clang compile X-Git-Tag: v2.42-start~317^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2c16fdb72a83aef157813045738ed5c96513309;p=thirdparty%2Futil-linux.git fix clang compile This commit fix clang compile issue. Replace local char veriables with generic ch already used by the in function. Reduce memory usage. --- diff --git a/term-utils/scriptreplay.c b/term-utils/scriptreplay.c index 0ab64e176..1cde3ef76 100644 --- a/term-utils/scriptreplay.c +++ b/term-utils/scriptreplay.c @@ -327,19 +327,18 @@ main(int argc, char *argv[]) replay_toggle_pause(setup); break; case '\033': - int first_char = fgetc(stdin); - if (first_char == '[') { - int second_char = fgetc(stdin); - - if (second_char == 'A') { /* Up arrow */ + ch = fgetc(stdin); + if (ch == '[') { + ch = fgetc(stdin); + if (ch == 'A') { /* Up arrow */ divi += 0.1; replay_set_delay_div(setup, divi); - } else if (second_char == 'B') { /* Down arrow */ + } else if (ch == 'B') { /* Down arrow */ divi -= 0.1; if (divi < 0.1) divi = 0.1; replay_set_delay_div(setup, divi); - } else if (second_char == 'C') { /* Right arrow */ + } else if (ch == 'C') { /* Right arrow */ rc = replay_emit_step_data(setup, step, STDOUT_FILENO); if (!rc) { rc = replay_get_next_step(setup, streams, &step);