Changeset c8bf88d in mainline for kernel/generic/src/lib/string.c
- Timestamp:
- 2009-04-03T15:52:14Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a7b1071
- Parents:
- 2398ee9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/string.c
r2398ee9 rc8bf88d 110 110 #include <align.h> 111 111 112 char invalch = '?';113 114 112 /** Byte mask consisting of lowest @n bits (out of 8) */ 115 113 #define LO_MASK_8(n) ((uint8_t) ((1 << (n)) - 1)) … … 135 133 * @param size Size of the string (in bytes). 136 134 * 137 * @return Value of decoded character, invalchon decoding error or135 * @return Value of decoded character, U_SPECIAL on decoding error or 138 136 * NULL if attempt to decode beyond @a size. 139 137 * … … 170 168 } else { 171 169 /* 10xxxxxx -- unexpected continuation byte */ 172 return invalch;170 return U_SPECIAL; 173 171 } 174 172 175 173 if (*offset + cbytes > size) 176 return invalch;174 return U_SPECIAL; 177 175 178 176 wchar_t ch = b0 & LO_MASK_8(b0_bits); … … 184 182 /* Must be 10xxxxxx */ 185 183 if ((b & 0xc0) != 0x80) 186 return invalch;184 return U_SPECIAL; 187 185 188 186 /* Shift data bits to ch */
Note:
See TracChangeset
for help on using the changeset viewer.