commit bebfc6da0ff6b2b3c0b4ba9cf5ff3ca0d8abe7dd
parent 0517c482e4b8f458958a1278c86d1cfe3d205aab
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 21 Jun 2005 22:48:38 +0000
put back erroneously removed bits
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2757 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2764,13 +2764,15 @@ char *do_browser(char *path, DIR *dir)
/* Aha! It's a symlink! Now, is it a dir? If so,
* mark it as such. */
if (stat(filelist[j], &st) == 0 &&
- S_ISDIR(st.st_mode))
+ S_ISDIR(st.st_mode)) {
strncpy(foo, _("(dir)"), foo_len);
- else
+ foo[foo_len] = '\0';
+ } else
strcpy(foo, "--");
- } else if (S_ISDIR(st.st_mode))
+ } else if (S_ISDIR(st.st_mode)) {
strncpy(foo, _("(dir)"), foo_len);
- else if (st.st_size < (1 << 10)) /* less than 1 k. */
+ foo[foo_len] = '\0';
+ } else if (st.st_size < (1 << 10)) /* less than 1 k. */
sprintf(foo, "%4u B", (unsigned int)st.st_size);
else if (st.st_size < (1 << 20)) /* less than 1 meg. */
sprintf(foo, "%4u KB",