Changeset 54e90cc in mainline
- Timestamp:
- 2011-03-23T22:51:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ff896e
- Parents:
- fca78d4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/ext2info/ext2info.c
rfca78d4 r54e90cc 49 49 #include <errno.h> 50 50 #include <libext2.h> 51 #include <assert.h> 51 52 52 53 #define NAME "ext2info" … … 96 97 --argc; ++argv; 97 98 98 if ( str_cmp(*argv, "--strict-check") == 0) {99 if (argc > 0 && str_cmp(*argv, "--strict-check") == 0) { 99 100 --argc; ++argv; 100 101 arg_flags |= ARG_STRICT_CHECK; 101 102 } 102 103 103 if ( str_cmp(*argv, "--superblock") == 0) {104 if (argc > 0 && str_cmp(*argv, "--superblock") == 0) { 104 105 --argc; ++argv; 105 106 arg_flags |= ARG_SUPERBLOCK; 106 107 } 107 108 108 if ( str_cmp(*argv, "--block-groups") == 0) {109 if (argc > 0 && str_cmp(*argv, "--block-groups") == 0) { 109 110 --argc; ++argv; 110 111 arg_flags |= ARG_BLOCK_GROUPS; 111 112 } 112 113 113 if ( str_cmp(*argv, "--inode") == 0) {114 if (argc > 0 && str_cmp(*argv, "--inode") == 0) { 114 115 --argc; ++argv; 115 116 if (argc == 0) { … … 128 129 --argc; ++argv; 129 130 130 if ( str_cmp(*argv, "--inode-data") == 0) {131 if (argc > 0 && str_cmp(*argv, "--inode-data") == 0) { 131 132 --argc; ++argv; 132 133 if (argc == 0) { … … 146 147 } 147 148 148 if ( str_cmp(*argv, "--list") == 0) {149 if (argc > 0 && str_cmp(*argv, "--list") == 0) { 149 150 --argc; ++argv; 150 151 arg_flags |= ARG_INODE_LIST; … … 152 153 } 153 154 154 if (argc != 1) { 155 if (argc < 1) { 156 printf(NAME ": Error, argument missing.\n"); 157 syntax_print(); 158 return 1; 159 } 160 else if (argc > 1) { 155 161 printf(NAME ": Error, unexpected argument.\n"); 156 162 syntax_print(); 157 163 return 1; 158 164 } 165 assert(argc == 1); 159 166 160 167 // Display common things by default
Note:
See TracChangeset
for help on using the changeset viewer.