make sure we don't have namespace clashes between libraries and apps
[osmocom-bb.git] / src / bits.c
index 029cfe5..ff5d176 100644 (file)
@@ -1,7 +1,7 @@
 
 #include <stdint.h>
 
-#include <osmocore/bits.h>
+#include <osmocom/core/bits.h>
 
 /* convert unpacked bits to packed bits, return length in bytes */
 int osmo_ubit2pbit(pbit_t *out, const ubit_t *in, unsigned int num_bits)
@@ -15,7 +15,7 @@ int osmo_ubit2pbit(pbit_t *out, const ubit_t *in, unsigned int num_bits)
 
                curbyte |= (in[i] << bitnum);
 
-               if (i > 0 && i % 8 == 0) {
+               if(i % 8 == 7){
                        *outptr++ = curbyte;
                        curbyte = 0;
                }