Changeset 5520 for pjproject/trunk/pjlib/src/pj/os_info.c
- Timestamp:
- Jan 11, 2017 4:38:29 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_info.c
r4610 r5520 99 99 100 100 static pj_uint32_t parse_version(char *str) 101 { 102 char *tok; 103 int i, maxtok; 101 { 102 int i, maxtok, found_idx; 104 103 pj_uint32_t version = 0; 104 pj_str_t in_str = pj_str(str); 105 pj_str_t token, delim; 105 106 106 107 while (*str && !pj_isdigit(*str)) … … 108 109 109 110 maxtok = 4; 110 for (tok = strtok(str, ".-"), i=0; tok && i<maxtok; 111 ++i, tok=strtok(NULL, ".-")) 111 delim = pj_str(".-"); 112 for (found_idx = pj_strtok(&in_str, &delim, &token, 0), i=0; 113 found_idx != in_str.slen && i < maxtok; 114 ++i, found_idx = pj_strtok(&in_str, &delim, &token, 115 found_idx + token.slen)) 112 116 { 113 117 int n; 114 118 115 if (!pj_isdigit(*tok ))119 if (!pj_isdigit(*token.ptr)) 116 120 break; 117 121 118 n = atoi(tok );122 n = atoi(token.ptr); 119 123 version |= (n << ((3-i)*8)); 120 124 }
Note: See TracChangeset
for help on using the changeset viewer.