diff options
| -rw-r--r-- | contrib/cvs/src/filesubr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/cvs/src/filesubr.c b/contrib/cvs/src/filesubr.c index b9f9bd5765b1..93538882f0ab 100644 --- a/contrib/cvs/src/filesubr.c +++ b/contrib/cvs/src/filesubr.c @@ -877,7 +877,7 @@ xreadlink (link) { char *file = NULL; int buflen = BUFSIZ; - int linklen; + int link_name_len; /* Get the name of the file to which `from' is linked. FIXME: what portability issues arise here? Are readlink & @@ -886,14 +886,15 @@ xreadlink (link) { file = xrealloc (file, buflen); errno = 0; - linklen = readlink (link, file, buflen - 1); + link_name_len = readlink (link, file, buflen - 1); buflen *= 2; } - while (linklen == -1 && errno == ENAMETOOLONG); + while (link_name_len < 0 && errno == ENAMETOOLONG); - if (linklen == -1) + if (link_name_len < 0) error (1, errno, "cannot readlink %s", link); - file[linklen] = '\0'; + + file[link_name_len] = '\0'; return file; } |
