title: Are ext2 directory entry names guaranteed to be null-terminated on a valid file system?
body: <p>I thought this would be an easy question, but I can't find the answer. I've mainly been reading these specs:</p>
  
  <p><a href="http://www.nongnu.org/ext2-doc/ext2.html" rel="nofollow">http://www.nongnu.org/ext2-doc/ext2.html</a></p>
  
  <p>It doesn't seem to mention if a directory entry's name is supposed to be null-terminated. I'm thinking that it's undefined. There is a name_len field, so you can easily print the name anyway.</p>
  
  <p>Are ext2 directory names guaranteed to be null-terminated?</p>
  
  <p>I ask because in testing my ext2 driver on my hobby OS I noticed when I printed some directory names some garbage characters came out on the end. If I simply print name_len characters everything is fine, although it'd be nice if it was null-terminated.</p>
  
  <p>Thanks!</p>