- Timestamp:
- 2016-11-12T03:38:34Z (8 years ago)
- Branches:
- master
- Children:
- 701ab812
- Parents:
- 727a68b
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.