From bbbaa5013d3a6f8106b9c6d121f5d9f8cf43fc82 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Wed, 22 Aug 2018 01:17:05 -0700 Subject: [PATCH] Fix text decoding. --- uv380.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uv380.c b/uv380.c index 1ce8781..f919a6a 100644 --- a/uv380.c +++ b/uv380.c @@ -440,7 +440,7 @@ static unsigned decode_tones(const unsigned char *source, unsigned offset) static void decode_text(const unsigned char *source, unsigned offset, uint16_t *target, unsigned nbytes) { source += offset; - while (nbytes-- > 0) { + for (; nbytes>1; nbytes-=2) { *target = source[0] | (source[1] << 8); source += 2; target++;