aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index 1869a29c3b..49032957d0 100644
--- a/file.c
+++ b/file.c
@@ -3563,7 +3563,7 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
#endif
long f = 0, n = -1;
- end = name + *alllen;
+ end = name + (alllen ? (size_t)*alllen : strlen(name));
name = skipprefix(name, end, enc);
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
root = name;