title: Wrong output inet_ntop
body: <p>I'm trying to print an ip address from inet_ntop, but the output seems pretty weird.</p>
  
  <p>The program seems to work well, I succeed to connect the socket but it print this: </p>
  
  <pre><code>H��H9�u�H�[]A\A]A^A_�ff.�
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;sys/socket.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;netdb.h&gt;
  #include &lt;string.h&gt;
  #include &lt;arpa/inet.h&gt;
  
  int main(int argc, char *argv[]){
      int sock = socket(AF_INET, SOCK_STREAM, 0); 
      struct addrinfo hints, *result;
      memset(&amp;hints, 0, sizeof(struct addrinfo));
      hints.ai_family = AF_INET;
      hints.ai_socktype = SOCK_STREAM;
      hints.ai_protocol = 0;
      hints.ai_flags = 0;
  
      int s = getaddrinfo("irc.root-me.org", "6667", &amp;hints, &amp;result);
      if( s != 0){ 
          printf("erreur\n");
          exit(EXIT_FAILURE);
      }   
  
      int f = connect(sock, result-&gt;ai_addr, result-&gt;ai_addrlen);
      if(f != 0){ 
          printf("erreur connect\n");
      }   
  
      struct sockaddr_in *sockin;  
      sockin = (struct sockaddr_in *)result-&gt;ai_addr;
      char  *dst;
      inet_ntop(AF_INET, &amp;sockin-&gt;sin_addr, dst, sizeof(char *));
      printf("%s\n", dst);
      freeaddrinfo(result);
  
      exit(0);
  }
  </code></pre>