summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-19 11:10:52 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-19 16:56:47 -0700
commite0ca083dada62cff23b58e9c55b48c854a436ff8 (patch)
treeaf42845f418103c258ea8f844aa3c258006ee1dc
parentbc75934a8912b237a7f4658d7cf28ddd9a766d41 (diff)
Fix -Wshorten-64-to-32 warnings from clang
lndir.c:252:11: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] symlen = readlink (dp->d_name, symbuf, sizeof(symbuf) - 1); ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lndir.c:261:19: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] basesymlen = readlink(buf, basesym, sizeof(basesym) - 1); ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--lndir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lndir.c b/lndir.c
index a5618c1..ad49d0a 100644
--- a/lndir.c
+++ b/lndir.c
@@ -148,8 +148,8 @@ dodir (const char *fn, /* name of "from" directory, either absolute or
char basesym[MAXPATHLEN + 1];
struct stat sb, sc;
int n_dirs;
- int symlen;
- int basesymlen = -1;
+ ssize_t symlen;
+ ssize_t basesymlen = -1;
char *ocurdir;
if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino)) {