diff src/fileio.c @ 5835:e24390bd4235

Fix off-by-one error in Ffile_truename. See <CAHCOHQnOwYH5kF0mq6184Fetuus-KOeKNUpTHYXhq56AvcuE9A@mail.gmail.com> in xemacs-patches.
author Jerry James <james@xemacs.org>
date Fri, 05 Dec 2014 16:56:13 -0700
parents a216b3c2b09e
children
line wrap: on
line diff
--- a/src/fileio.c	Fri Dec 05 16:22:57 2014 -0700
+++ b/src/fileio.c	Fri Dec 05 16:56:13 2014 -0700
@@ -1466,7 +1466,7 @@
       if (elen > 0 && IS_DIRECTORY_SEP (string_byte (expanded_name, elen - 1))
           && !(rlen > 0 && IS_DIRECTORY_SEP (resolved_path[rlen - 1])))
 	{
-	  if (rlen + 1 > countof (resolved_path))
+	  if (rlen + 1 >= countof (resolved_path))
 	    goto toolong;
 	  resolved_path[rlen++] = DIRECTORY_SEP;
 	  resolved_path[rlen] = '\0';