Changeset 81e9cb3 in mainline for uspace/lib/c/generic/str.c


Ignore:
Timestamp:
2011-08-24T21:51:57Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26ad20b
Parents:
980311e
Message:

Make wstr_to_str() and str_to_wstr() void functions again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/str.c

    r980311e r81e9cb3  
    620620 * @param size  Size of the destination buffer.
    621621 * @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 */
     623void wstr_to_str(char *dest, size_t size, const wchar_t *src)
     624{
    628625        wchar_t ch;
    629626        size_t src_idx;
     
    637634
    638635        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)
    641637                        break;
    642638        }
    643639
    644640        dest[dest_off] = '\0';
    645         return rc;
    646641}
    647642
     
    782777 * @param dlen  Length of destination buffer (number of wchars).
    783778 * @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 */
     780void str_to_wstr(wchar_t *dest, size_t dlen, const char *src)
     781{
    790782        size_t offset;
    791783        size_t di;
     
    798790
    799791        do {
    800                 if (di >= dlen - 1) {
    801                         rc = EOVERFLOW;
     792                if (di >= dlen - 1)
    802793                        break;
    803                 }
    804794
    805795                c = str_decode(src, &offset, STR_NO_LIMIT);
     
    808798
    809799        dest[dlen - 1] = '\0';
    810         return rc;
    811800}
    812801
Note: See TracChangeset for help on using the changeset viewer.