From 00cc8fe7b861863177dcecd84f7b41ccb0328f7b Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 22 Mar 2025 18:27:13 +0100 Subject: [PATCH] now? --- src/rds.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rds.c b/src/rds.c index aaee091..bb6f40e 100644 --- a/src/rds.c +++ b/src/rds.c @@ -823,6 +823,10 @@ void set_rds_rt1(RDSEncoder* enc, char *rt1) { memset(enc->data[enc->program].rt1, ' ', RT_LENGTH); while (*rt1 != 0 && len < RT_LENGTH) enc->data[enc->program].rt1[len++] = *rt1++; + while (len > 0 && enc->data[enc->program].rt1[len - 1] == ' ') { + len--; + } + if (len < RT_LENGTH && enc->data[enc->program].shortrt) { enc->state[enc->program].rt_segments = 0; @@ -845,6 +849,10 @@ void set_rds_rt2(RDSEncoder* enc, char *rt2) { memset(enc->data[enc->program].rt2, ' ', RT_LENGTH); while (*rt2 != 0 && len < RT_LENGTH) enc->data[enc->program].rt2[len++] = *rt2++; + while (len > 0 && enc->data[enc->program].rt2[len - 1] == ' ') { + len--; + } + if (len < RT_LENGTH && enc->data[enc->program].shortrt) { enc->state[enc->program].rt2_segments = 0;