C or C++ : Use of overlapping buffers