This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix various compiler warnings from XS code
[perl5.git] / dist / Cwd / Cwd.xs
index 123be68..421c9df 100644 (file)
@@ -106,7 +106,7 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
                 */
                p = strchr(left, '/');
                s = p ? p : left + left_len;
-               if (s - left >= sizeof(next_token)) {
+               if ((STRLEN)(s - left) >= (STRLEN)sizeof(next_token)) {
                        errno = ENAMETOOLONG;
                        return (NULL);
                        }
@@ -190,7 +190,7 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
         */
                                if (p != NULL) {
                                        if (symlink[slen - 1] != '/') {
-                                               if (slen + 1 >= sizeof(symlink)) {
+                                               if ((STRLEN)(slen + 1) >= (STRLEN)sizeof(symlink)) {
                        errno = ENAMETOOLONG;
                                                        return (NULL);
                }