summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Tree.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx
index 139e8ed6d..9c8bc9365 100644
--- a/src/Fl_Tree.cxx
+++ b/src/Fl_Tree.cxx
@@ -1228,8 +1228,8 @@ int Fl_Tree::item_pathname(char *pathname, int pathnamelen, const Fl_Tree_Item *
SAFE_RCAT('/'); // rcat leading slash
item = item->parent(); // move up tree (NULL==root)
}
- if ( *(++s) == '/' ) ++s; // leave off leading slash from pathname
- if ( s != pathname ) memmove(pathname, s, slen); // Shift down right-aligned string
+ if ( *(++s) == '/' ) { ++s; --slen; } // leave off leading slash from pathname
+ if ( s != pathname ) memmove(pathname, s, slen); // Shift down right-aligned string
return(0);
}