From 037071da4fcdbecd2af696b2ec1dd2ec17a6d9a9 Mon Sep 17 00:00:00 2001 From: mjn3 Date: Thu, 14 Aug 2003 02:28:49 +0000 Subject: Fix a bug reported by junkio@cox.net involving the mode_chars index. git-svn-id: svn://busybox.net/trunk/busybox@7207 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- libbb/mode_string.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libbb') diff --git a/libbb/mode_string.c b/libbb/mode_string.c index 8d4d736ef..83142ba8a 100644 --- a/libbb/mode_string.c +++ b/libbb/mode_string.c @@ -20,6 +20,11 @@ * */ +/* Aug 13, 2003 + * Fix a bug reported by junkio@cox.net involving the mode_chars index. + */ + + #include #include @@ -119,7 +124,7 @@ const char *bb_mode_string(int mode) } while (++j < 3); ++i; if (mode & (010000 >> i)) { - *p = mode_chars[3 + k + (i >> 1)]; + *p = mode_chars[3 + (k & 2) + (i == 3)]; } } while (i < 3); -- cgit v1.2.3-55-g6feb