changed & to %, before it seemed to assume the buffer size was a power of
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 20 Nov 2002 00:43:19 +0000 (00:43 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 20 Nov 2002 00:43:19 +0000 (00:43 +0000)
2

demo/mmap.c

index 2da8e40bacbcb1d102c0b40afc01e5537304029c..25b9b850083226c12cd8716e7074603a67111248 100644 (file)
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
 
                for(i=back;i<front;i+=sizeof(sampl_t)){
                        static int col = 0;
-                       printf("%d ",*(sampl_t *)(map+(i&(size-1))));
+                       printf("%d ",*(sampl_t *)(map+(i%size)));
                        col++;
                        if(col==n_chan){
                                printf("\n");