Browse Source

chmod: fix infinite loop parsing octal modes

K. Lange 2 years ago
parent
commit
f213be0334
1 changed files with 1 additions and 1 deletions
  1. 1 1
      apps/chmod.c

+ 1 - 1
apps/chmod.c

@@ -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++;