Changeset 6201646
- Timestamp:
- Dec 28, 2007, 5:21:57 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 7b1d048
- Parents:
- 5376a95
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
message.c
r5376a95 r6201646 79 79 owl_list_append_element(&(m->attributes), pair); 80 80 } 81 owl_pair_set_value(pair, owl_validate_or_convert(attrvalue , -1));81 owl_pair_set_value(pair, owl_validate_or_convert(attrvalue)); 82 82 } 83 83 -
util.c
r5376a95 r6201646 801 801 * for formatting. 802 802 */ 803 char * owl_validate_or_convert(char *in , int len)804 { 805 if (g_utf8_validate(in, len, NULL)) {803 char * owl_validate_or_convert(char *in) 804 { 805 if (g_utf8_validate(in, -1, NULL)) { 806 806 return owl_strip_format_chars(in); 807 807 } 808 808 else { 809 return g_convert(in, len,809 return g_convert(in, -1, 810 810 "UTF-8", "ISO-8859-1", 811 811 NULL, NULL, NULL); -
zephyr.c
r5376a95 r6201646 369 369 if (count == j) { 370 370 /* just found the end of the field we're looking for */ 371 return(owl_validate_or_convert(n->z_message + save , -1));371 return(owl_validate_or_convert(n->z_message + save)); 372 372 } else { 373 373 save = i + 1; … … 377 377 /* catch the last field, which might not be null terminated */ 378 378 if (count == j - 1) { 379 return owl_validate_or_convert(n->z_message + save, n->z_message_len - save); 379 char *tmp, *out; 380 tmp = owl_malloc(n->z_message_len-save+5); 381 memcpy(tmp, n->z_message+save, n->z_message_len-save); 382 tmp[n->z_message_len-save]='\0'; 383 out = owl_validate_or_convert(tmp); 384 owl_free(tmp); 385 return out; 380 386 } 381 387
Note: See TracChangeset
for help on using the changeset viewer.