Debian Codegraph @

debian/patches/error

raw
1 https://github.com/linux-speakup/espeakup/pull/51
2
3 commit 1af2098974bb8e2b3330a7d218164f036bfd6709
4 Author: Samuel Thibault <[email protected]>
5 Date: Mon Aug 15 23:48:26 2022 +0200
6
7 queue_process_entry: Avoid leaving error uninitialized
8
9 CMD_PAUSE was not actually setting error to EE_OK, and the default case,
10 even if it is not supposed to happen, should set error to something sane.
11
12 diff --git a/src/espeak.c b/src/espeak.c
13 index 135c6b5..9a9f9ac 100644
14 --- a/src/espeak.c
15 +++ b/src/espeak.c
16 @@ -377,12 +377,18 @@ static void queue_process_entry(struct synth_t *s)
17 break;
18 case CMD_PAUSE:
19 if (!paused_espeak) {
20 - espeak_Cancel();
21 - espeak_Terminate();
22 - paused_espeak = 1;
23 + error = espeak_Cancel();
24 + if (error == EE_OK)
25 + error = espeak_Terminate();
26 + if (error == EE_OK)
27 + paused_espeak = 1;
28 + } else {
29 + error = EE_OK;
30 }
31 break;
32 default:
33 + /* Uh? */
34 + error = EE_OK;
35 break;
36 }
37