]> git.karo-electronics.de Git - rdstmc.git/blobdiff - decoder/rds.c
some cleanups in reading
[rdstmc.git] / decoder / rds.c
index 27a417c49398053184b816b084fd72c8695d0b37..bdaee7b9fe76ff0f8e2bb75da20a704a3a18f3d0 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;
 }