blob: 648bb80f14c5442a59ea726b6b86eee34fc8e74f [file] [log] [blame]
/* Off-by-one memmove() */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main()
{
char string1[] = "A String";
char *ptr;
ptr = malloc(sizeof(string1));
strcpy(ptr, string1);
memmove(&ptr[1], ptr, sizeof(string1));
free(ptr);
return 0;
}