title: How to make sscanf read until '\0' character
body: <p>I want name to have all the characters remaining in the line until the <code>'\0'</code>.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      char line[] = "1999-08-01,14.547,0.191,United Kingdom";
      unsigned int year, month, day;
      float temp, uncertainty;
      char name[100];
      sscanf(line, "%u - %u - %u, %f , %f , %s", &amp;year, &amp;month,
                         &amp;day, &amp;temp, &amp;uncertainty, name);
      printf("%u-%u-%u,%lf,%lf,%s\n", year, month, day, temp, uncertainty, name);
  }
  </code></pre>
  
  <p>I can make this work like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  int main(){
      char line[] = "1999-08-01,14.547,0.191,United Kingdom";
      char* newline = malloc(strlen(line) + 2);
      strcpy(newline, line);
      newline[strlen(newline)] = '\n';
      newline[strlen(newline)] = '\0';
      unsigned int year, month, day;
      float temp, uncertainty;
      char name[100];
      sscanf(line, "%u - %u - %u, %f , %f , %[^\n]", &amp;year, &amp;month,
                         &amp;day, &amp;temp, &amp;uncertainty, name);
      printf("%u-%u-%u,%lf,%lf,%s\n", year, month, day, temp, uncertainty, name);
  }
  </code></pre>
  
  <p>But I find this very inelegant. </p>