title: Printf char[] buffer overflow
body: <p>I've this problem, my nome's is a char[20], if I insert some character the array comes into overflow and write in the other array (cognome).</p>
  
  <p>I've tried to change the scanf() with puts(), but this last one wont work properly because it jump off the input and doesn't read nothing.</p>
  
  <hr>
  
  <p>Someone know solutions?</p>
  
  <p>Here is the code</p>
  
  <pre><code>void addStudent(){
      struct student s;
      printf("Inserire Nome: ");
      scanf("%20s",s.nome);
      printf("\nInserire Cognome: ");
      scanf("%30s",s.cognome);
      printf("\nInserire eta': ");
      scanf("%d",&amp;s.anni);
  }
  </code></pre>
  
  <p>Result</p>
  
  <pre><code>Inserire Nome: cjhsdjkhbsdkhfgsdjkhfgskjhgjkhsfs
  
  Inserire Cognome: 
  Inserire eta': 
  </code></pre>