#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main()
{
	const char* source = "0123"; 

	// Replacing the bufferLength by 8 will solve the issue of -O2	
	size_t bufferLength = 6;
	char* destination = static_cast<char*>(calloc(bufferLength, 1));
	strcpy(destination, source);
	printf("EXPECT STRLENGTH OF 4: %zu\n", strlen(destination));
	printf("EXPECT STR \"0123\": %s\n", destination);

	free(destination);
}
