Some tips:

1. mes[12]=31;

This is not going to work because your array is 12 long (0-11)

2. void main(void)

This is wrong, use int main(void);

3. int mes[12];

You can also fill the array when declaring it:
int mes[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

4. char *fecha1=malloc(sizeof(char)*9);

If you allocate something it's always nice to free the allocated memmory (same for fecha2).
Why do you use dynamic memory anyway??:
Code:
char fecha1[9];
char fecha2[9];
char dummy[9];