Changeset 923:6a4d08e239bd in freeDiameter
- Timestamp:
- Feb 14, 2013, 11:58:55 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/dictionary_functions.c
r922 r923 228 228 char * end = strchr(ret, '\0'); 229 229 230 230 while (end > ret) { 231 end--; 232 char b = *end; 233 /* after the position pointed by end, we have only \0s */ 234 if ((b & 0x80) == 0) { 235 break; /* this is a single byte char, no problem */ 236 } else { 237 /* this byte is start or cont. of multibyte sequence, as we do not know the next byte we need to delete it. */ 238 *end = '\0'; 239 if (b & 0x40) 240 break; /* This was a start byte, we can stop the loop */ 241 } 242 } 231 243 } 232 244 return ret;
Note: See TracChangeset
for help on using the changeset viewer.