int shift = 0;
unsigned char *tmp = (unsigned char *)calloc(1, src_size+1);
- for (i = 0; i < src_size; i++) {
- tmp[i] = src[i] << 1;
- }
if (tmp == NULL){
MSG_ERR("failed to allocate memory");
}
for (i = 0; i < src_size; i++) {
+ tmp[i] = src[i] << 1;
+ }
+
+ for (i = 0; i < src_size; i++) {
shift = j % 7;
dest[j++] = (tmp[i] << shift) + (tmp[i+1] >> (7-shift));
if (shift == 6) {