title: sscanf not working right?
body: <p>I am trying to parse a URL, and wrote this code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      char host[100];
      char port[100];
      char path[100];
      char prot[100];
      char* url = "https://google.com:8000/foobar";
      sscanf(url, "%s://%s:%s/%s", prot, host, port, path);
      printf("Protocol: %s\n", prot);
      printf("Host:     %s\n", host);
      printf("Port:     %s\n", port);
      printf("Path:     %s\n", path);
  
      return 0;
  }
  </code></pre>
  
  <p>However, it outputs this:</p>
  
  <pre><code>Protocol: https://google.com:8000/foobar
  Host:     å0&amp;TFaa
  Port:     
  Path:
  </code></pre>
  
  <p>I'm not sure why it is putting all of my string into the protocol variable, instead of putting the correct parts into each variable.  Any ideas?</p>