this only checks for equal buffers, can partially overlapping buffers happen?

also the variable names do not make it easy to read this code, why are the buffers swapped?