Changeset 1433ecda in mainline for uspace/lib/c/generic/str.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
r47b2d7e3 r1433ecda 49 49 /** Check the condition if wchar_t is signed */ 50 50 #ifdef __WCHAR_UNSIGNED__ 51 51 #define WCHAR_SIGNED_CHECK(cond) (true) 52 52 #else 53 53 #define WCHAR_SIGNED_CHECK(cond) (cond) 54 54 #endif 55 55 … … 164 164 /* 0xxxxxxx (Plain ASCII) */ 165 165 return b & 0x7f; 166 } 167 else if ((b & 0xe0) == 0xc0 || (b & 0xf0) == 0xe0 || 166 } else if ((b & 0xe0) == 0xc0 || (b & 0xf0) == 0xe0 || 168 167 (b & 0xf8) == 0xf0) { 169 168 /* Start byte */ 170 169 size_t start_offset = *offset; 171 170 return str_decode(str, &start_offset, size); 172 } 173 else if ((b & 0xc0) != 0x80) { 171 } else if ((b & 0xc0) != 0x80) { 174 172 /* Not a continuation byte */ 175 173 return U_SPECIAL; … … 936 934 ch += (src[idx + 1] & 0x03FF); 937 935 idx += 2; 938 } 939 else 936 } else 940 937 break; 941 938 } else { … … 983 980 idx++; 984 981 } else { 985 982 dest[idx] = c; 986 983 } 987 984 … … 1110 1107 size_t len = str_length(str); 1111 1108 1112 wchar_t *wstr = calloc(len +1, sizeof(wchar_t));1109 wchar_t *wstr = calloc(len + 1, sizeof(wchar_t)); 1113 1110 if (wstr == NULL) 1114 1111 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.