title: Null-terminating a string in C
body: <p>I have a string with some spaces on the end. I would like to terminate this string at the position when the first space occurs, so that when I later do <code>strncpy()</code> on it, it would copy only the part of the string which doesn't contain spaces.</p>
  
  <p>This is some try which gives me a segault obviously. How can I do what I intend to do?</p>
  
  <pre><code>int main() {
      char* s1 = "SomeString             ";
      *(s1 + 10)='\0';
      printf("%s\n",s1);
  
      return 0;
  }
  </code></pre>