chmod: fix infinite loop parsing octal modes

This commit is contained in:
K. Lange 2018-11-07 11:54:42 +09:00
parent c2e0255066
commit f213be0334

View File

@ -51,7 +51,7 @@ int main(int argc, char * argv[]) {
switch (*c) {
case '0':
c++; /* 0 */
while (*c >= '0' || *c <= '7') {
while (*c >= '0' && *c <= '7') {
mode *= 8;
mode += (*c - '0');
c++;