--- In [email protected], Ahmed Shabana <unlimited...@...> wrote:
>
> THIS CODE through a segmentation fault at PC= 0x80485e9 "from GDB"
> and I donot know why ?? can any one help ?
> 
>       //char* message[100]; //This just for testing if sprintf() use
malloc() or not
>       char* message;
>       sprintf(message,"GET /index.html\n");

sprintf() doesn't use malloc(); it should be:

    char message[100]; /* not char* */
    sprintf(message, "...

Are you using gdb? If so, try compiling with the -g option, then you
might get more information about where the segmentation fault is
happening.

John

Reply via email to