Fixed out-of-bounds access as well as bad testing of mode
Fixed out-of-bounds access as well as bad testing of mode

cc-archive/svn-liblicense,cc-archive/svn-liblicense,cc-archive/svn-liblicense,cc-archive/svn-liblicense,cc-archive/svn-liblicense,cc-archive/svn-liblicense