src/arguments.c

changeset 66
be2084398c37
parent 57
68018eac46c3
equal deleted inserted replaced
65:49fa681f3a7e 66:be2084398c37
25 */ 25 */
26 26
27 #include "arguments.h" 27 #include "arguments.h"
28 28
29 int checkArgument(const char* arg, const char* expected) { 29 int checkArgument(const char* arg, const char* expected) {
30 int len = strlen(expected); 30 size_t len = strlen(expected);
31 int ret = 0; 31 int ret = 0;
32 32
33 if (arg[0] == '-') { 33 if (arg[0] == '-') {
34 if (arg[1] != '-') { 34 if (arg[1] != '-') {
35 for (int t = 0 ; t < len ; t++) { 35 for (size_t t = 0 ; t < len ; t++) {
36 ret |= (strchr(arg, expected[t])?1:0) << t; 36 ret |= (strchr(arg, expected[t])?1:0) << t;
37 } 37 }
38 } 38 }
39 } 39 }
40 40

mercurial