Changeset fca4683
- Timestamp:
- 2016-11-12T03:38:34Z (8 years ago)
- Branches:
- master
- Children:
- 701ab812
- Parents:
- 727a68b
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/misc.c
r727a68b rfca4683 549 549 } 550 550 551 /* Word wrapping. Yes, I know this isn't UTF-8 clean. I'm willing to take the risk. */552 551 char *word_wrap(const char *msg, int line_len) 553 552 { … … 582 581 } 583 582 if (i == 0) { 584 g_string_append_len(ret, msg, line_len); 583 const char *end; 584 size_t len; 585 586 g_utf8_validate(msg, line_len, &end); 587 588 len = (end != msg) ? end - msg : line_len; 589 590 g_string_append_len(ret, msg, len); 585 591 g_string_append_c(ret, '\n'); 586 msg += l ine_len;592 msg += len; 587 593 } 588 594 } -
tests/check_util.c
r727a68b rfca4683 137 137 5, 138 138 "aaaaa\naaaaa\naaaaa\naaaaa\naaaaa\naaaaa\naaaaa\na", 139 }, 140 { 141 "áááááááááá", 142 11, 143 "ááááá\nááááá", 139 144 }, 140 145 {
Note: See TracChangeset
for help on using the changeset viewer.