Changeset 5532 for pjproject/branches/projects/uwp/pjlib/src/pj/os_info.c
- Timestamp:
- Jan 18, 2017 10:55:35 AM (8 years ago)
- Location:
- pjproject/branches/projects/uwp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/uwp
- Property svn:mergeinfo changed
/pjproject/trunk merged: 5516-5525,5527,5530-5531
- Property svn:mergeinfo changed
-
pjproject/branches/projects/uwp/pjlib/src/pj/os_info.c
r5515 r5532 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 ))116 break; 117 118 n = atoi(tok );119 if (!pj_isdigit(*token.ptr)) 120 break; 121 122 n = atoi(token.ptr); 119 123 version |= (n << ((3-i)*8)); 120 124 }
Note: See TracChangeset
for help on using the changeset viewer.