Changeset 81e9cb3 in mainline
- Timestamp:
- 2011-08-24T21:51:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 26ad20b
- Parents:
- 980311e
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
r980311e r81e9cb3 620 620 * @param size Size of the destination buffer. 621 621 * @param src Source wide string. 622 * 623 * @return EOK, if success, negative otherwise. 624 */ 625 int wstr_to_str(char *dest, size_t size, const wchar_t *src) 626 { 627 int rc; 622 */ 623 void wstr_to_str(char *dest, size_t size, const wchar_t *src) 624 { 628 625 wchar_t ch; 629 626 size_t src_idx; … … 637 634 638 635 while ((ch = src[src_idx++]) != 0) { 639 rc = chr_encode(ch, dest, &dest_off, size - 1); 640 if (rc != EOK) 636 if (chr_encode(ch, dest, &dest_off, size - 1) != EOK) 641 637 break; 642 638 } 643 639 644 640 dest[dest_off] = '\0'; 645 return rc;646 641 } 647 642 … … 782 777 * @param dlen Length of destination buffer (number of wchars). 783 778 * @param src Source string. 784 * 785 * @return EOK, if success, negative otherwise. 786 */ 787 int str_to_wstr(wchar_t *dest, size_t dlen, const char *src) 788 { 789 int rc=EOK; 779 */ 780 void str_to_wstr(wchar_t *dest, size_t dlen, const char *src) 781 { 790 782 size_t offset; 791 783 size_t di; … … 798 790 799 791 do { 800 if (di >= dlen - 1) { 801 rc = EOVERFLOW; 792 if (di >= dlen - 1) 802 793 break; 803 }804 794 805 795 c = str_decode(src, &offset, STR_NO_LIMIT); … … 808 798 809 799 dest[dlen - 1] = '\0'; 810 return rc;811 800 } 812 801 -
uspace/lib/c/include/str.h
r980311e r81e9cb3 80 80 extern void str_append(char *dest, size_t size, const char *src); 81 81 82 extern int wstr_to_str(char *dest, size_t size, const wchar_t *src);83 82 extern int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n); 83 extern void wstr_to_str(char *dest, size_t size, const wchar_t *src); 84 84 extern char *wstr_to_astr(const wchar_t *src); 85 extern void str_to_wstr(wchar_t *dest, size_t dlen, const char *src); 85 86 extern wchar_t *str_to_awstr(const char *src); 86 extern int str_to_wstr(wchar_t *dest, size_t dlen, const char *src);87 87 extern int utf16_to_str(char *dest, size_t size, const uint16_t *src); 88 88 extern int str_to_utf16(uint16_t *dest, size_t size, const char *src);
Note:
See TracChangeset
for help on using the changeset viewer.