aboutsummaryrefslogtreecommitdiffstats
path: root/src/jolly
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2019-09-28 15:49:04 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2019-11-29 15:58:32 +0100
commit860f91af6f0f1ad5598f0009cdab08a8286511c8 (patch)
treef9ecd68a3ec75eda73df4a16f2e006414a27ff45 /src/jolly
parent830794bae4aa5ece6c91ba33bad192076ada5ca5 (diff)
Bugfix: Correct handling of n in strncat()
Diffstat (limited to 'src/jolly')
-rw-r--r--src/jolly/dsp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jolly/dsp.c b/src/jolly/dsp.c
index b9f39bb..94231fd 100644
--- a/src/jolly/dsp.c
+++ b/src/jolly/dsp.c
@@ -144,7 +144,7 @@ void set_speech_string(jolly_t *jolly, char announcement, const char *number)
{
jolly->speech_string[0] = announcement;
jolly->speech_string[1] = '\0';
- strncat(jolly->speech_string, number, sizeof(jolly->speech_string) - 1);
+ strncat(jolly->speech_string, number, sizeof(jolly->speech_string) - strlen(number) - 1);
jolly->speech_digit = 0;
jolly->speech_pos = 0;
}