I\'ve some doubts about fgets. From what I know, it adds \"\\n\" at the end of the string, and not \"\\0\". So if I write this code:
fgets(buff,2,stdin); pri
It must terminate the string, so yes it will always add '\0' at the end. However, fgets might not always add the newline, if it doesn't fit. I recommend this reference page for fgets.
'\0'
fgets