summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 4d915ca3b8..730c59f611 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -511,13 +511,13 @@ void resume_directory(const char *dir)
511 511
512/* Returns the current working directory and also writes cwd to buf if 512/* Returns the current working directory and also writes cwd to buf if
513 non-NULL. In case of error, returns NULL. */ 513 non-NULL. In case of error, returns NULL. */
514char *getcwd(char *buf, size_t size) 514char *getcwd(char *buf, getcwd_size_t size)
515{ 515{
516 if (!buf) 516 if (!buf)
517 return tc.currdir; 517 return tc.currdir;
518 else if (size) 518 else if (size)
519 { 519 {
520 if (strlcpy(buf, tc.currdir, size) < size) 520 if ((getcwd_size_t)strlcpy(buf, tc.currdir, size) < size)
521 return buf; 521 return buf;
522 } 522 }
523 /* size == 0, or truncation in strlcpy */ 523 /* size == 0, or truncation in strlcpy */