From d4f8c46bc4a5cad443611ac86bfe0a83a9d1b49b Mon Sep 17 00:00:00 2001 From: Nils Faerber Date: Sun, 2 Jan 2011 01:54:07 +0100 Subject: [PATCH] some cleanups in reading --- decoder/rds.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/decoder/rds.c b/decoder/rds.c index 27a417c..bdaee7b 100644 --- a/decoder/rds.c +++ b/decoder/rds.c @@ -95,9 +95,11 @@ unsigned char offset; rb = read(rds_fd, rbuf, 3); if (rb <= 0) - exit(0); // just for testing - if (rb != 3) + return 0; + if (rb != 3) { printf("#read err rb=%d\n", rb); + return 0; + } block = rbuf[0] | (rbuf[1] << 8); offset = rbuf[2] & 0x07; @@ -124,6 +126,7 @@ unsigned char offset; } if (OutputFlags & RDS_RECEIVE_INDICATOR) printf("."); + return 0; } -- 2.39.2