debes agregar una pequeña linea. USA RANDOMIZE :
/* malloc example: string generator*/
#include <stdio.h>
#include <stdlib.h>
int main ()
{
randomize; //------ esto es todo :-) javascript:emoticon(':comp:')
smilie
smilie
int i,n;
char * buffer;
printf ("How long do you want the string? ");
scanf ("%d", &i);
buffer = (char*) malloc (i+1);
if (buffer==NULL) exit (1);
for (n=0; n<i; n++)
buffer[n]=rand()%26+'a';
buffer='\0';
printf ("Random string: %s\n",buffer);
free (buffer);
return 0;
}