Replace strcpy which has undefined behaviour in standard for overlapping strings +
minor refinement to buffer check code + remove unused #define.