some cleanups in reading
authorNils Faerber <nils.faerber@kernelconcepts.de>
Sun, 2 Jan 2011 00:54:07 +0000 (01:54 +0100)
committerNils Faerber <nils.faerber@kernelconcepts.de>
Sun, 2 Jan 2011 00:54:07 +0000 (01:54 +0100)
decoder/rds.c

index 27a417c..bdaee7b 100644 (file)
@@ -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;
 }