aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-14 02:28:49 +0000
committermjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-14 02:28:49 +0000
commit037071da4fcdbecd2af696b2ec1dd2ec17a6d9a9 (patch)
tree617233bd75fd9211892e0ed5d9c2720b302adb5c
parent8555b8c8683e500494050e2d059ce08f380beda3 (diff)
downloadbusybox-w32-037071da4fcdbecd2af696b2ec1dd2ec17a6d9a9.tar.gz
busybox-w32-037071da4fcdbecd2af696b2ec1dd2ec17a6d9a9.tar.bz2
busybox-w32-037071da4fcdbecd2af696b2ec1dd2ec17a6d9a9.zip
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
-rw-r--r--libbb/mode_string.c7
1 files changed, 6 insertions, 1 deletions
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 @@
20 * 20 *
21 */ 21 */
22 22
23/* Aug 13, 2003
24 * Fix a bug reported by junkio@cox.net involving the mode_chars index.
25 */
26
27
23#include <assert.h> 28#include <assert.h>
24#include <sys/stat.h> 29#include <sys/stat.h>
25 30
@@ -119,7 +124,7 @@ const char *bb_mode_string(int mode)
119 } while (++j < 3); 124 } while (++j < 3);
120 ++i; 125 ++i;
121 if (mode & (010000 >> i)) { 126 if (mode & (010000 >> i)) {
122 *p = mode_chars[3 + k + (i >> 1)]; 127 *p = mode_chars[3 + (k & 2) + (i == 3)];
123 } 128 }
124 } while (i < 3); 129 } while (i < 3);
125 130