title: tolower() function problems
body: <p>this is my example code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  #include&lt;ctype.h&gt;
  
  void convert(char *a, char *b) {
      int i;
      for(i=0; i&lt;strlen(a); i++) {
          b[i]=tolower(a[i]);
      }
  }
  
  int main() {
      char a[20], b[20];
  
      fgets(a, sizeof(a), stdin);
      convert(a, b);
      printf("%s\n", b);
      return 0;
  }
  </code></pre>
  
  <p>but sometimes the convert() function convert also one more char than strlen(a) (it's a random char), for example this is an output:</p>
  
  <pre><code>ASDSA
  asdsa
  %
  </code></pre>
  
  <p>How can i fix it?</p>