Copy memory blocks of different sizes Is there a better way than this to copy the values from source to destination when the blocks of memory you want to copy to and from are different sizes? Also considering you have no control over making sure the sizes match to begin with.

while (count--) {
   memcpy(dst, src, dst_stride);
   src += src_stride;
   dst += dst_stride;
}
If it is possible that the strides match then you can add a if check to just copy it all in one go:

if(src_stride == dst_stride){
    memcpy(dst, src, count * dst_stride);
} else {
    while (count--) {
       memcpy(dst, src, dst_stride);
       src += src_stride;
       dst += dst_stride;
    }
}