]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fix clang compile
authorjNullj <15849761+jNullj@users.noreply.github.com>
Mon, 27 May 2024 16:18:15 +0000 (19:18 +0300)
committerjNullj <15849761+jNullj@users.noreply.github.com>
Mon, 27 May 2024 16:18:15 +0000 (19:18 +0300)
This commit fix clang compile issue.
Replace local char veriables with generic ch already used by the in function.
Reduce memory usage.

term-utils/scriptreplay.c

index 0ab64e1762780d38de1d141ea245d8f3c4123a5d..1cde3ef769e4367c6a36fd6ac90af02f12109fc8 100644 (file)
@@ -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);