Changeset b67c7d64 in mainline for uspace/app


Ignore:
Timestamp:
2009-11-30T19:51:29Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e866806
Parents:
0f06dbc
Message:

Add wstr_to_astr() for easy conversion from wide string to string.

Location:
uspace/app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    r0f06dbc rb67c7d64  
    134134static char *tinput_get_str(tinput_t *ti)
    135135{
    136         char *str;
    137 
    138         str = malloc(STR_BOUNDS(ti->nc) + 1);
    139         if (str == NULL)
    140                 return NULL;
    141 
    142         wstr_to_str(str, STR_BOUNDS(ti->nc) + 1, ti->buffer);
    143 
    144         return str;
     136        return wstr_to_astr(ti->buffer);
    145137}
    146138
  • uspace/app/edit/edit.c

    r0f06dbc rb67c7d64  
    391391
    392392        buffer[nc] = '\0';
    393 
    394         str = malloc(STR_BOUNDS(wstr_length(buffer)) + 1);
    395         if (str == NULL)
    396                 return NULL;
    397 
    398         wstr_to_str(str, STR_BOUNDS(wstr_length(buffer)) + 1, buffer);
     393        str = wstr_to_astr(buffer);
    399394
    400395        console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0);
Note: See TracChangeset for help on using the changeset viewer.