title: fgets cutting off input after 3rd character
body: <p>I have a function to take in and format user input, but it keeps cutting off the input after the 3rd character.</p>
  <pre><code>void formatInput(char *input_variable) {
      fgets(input_variable, sizeof(input_variable), stdin);
      strtok(input_variable, &quot;\n&quot;);
  }
  
  int main() {
      char input_string[255];
      printf(&quot;Enter input: &quot;);
      formatInput(&amp;input_string[0]);
  
     return 0;
  }
  </code></pre>
  <p>If I enter <code>myinput</code> then it gets stored as <code>myi</code>. If I don't wrap it in this function, then it works perfectly fine.</p>