Ignore:
Timestamp:
2011-01-07T18:57:55Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e08a733
Parents:
7c34b28f
Message:
  • make measured_string and other network-related data types binary-safe
  • fix several network-related routines binary-safe (replace clearly suspicious use of str_lcmp() with bcmp())
  • rename spawn() to net_spawn()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/measured_strings.c

    r7c34b28f r61bfc370  
    5959 */
    6060measured_string_t *
    61 measured_string_create_bulk(const char *string, size_t length)
     61measured_string_create_bulk(const uint8_t *string, size_t length)
    6262{
    6363        measured_string_t *new;
     
    6868        }
    6969        new = (measured_string_t *) malloc(sizeof(measured_string_t) +
    70             (sizeof(char) * (length + 1)));
     70            (sizeof(uint8_t) * (length + 1)));
    7171        if (!new)
    7272                return NULL;
    7373
    7474        new->length = length;
    75         new->value = ((char *) new) + sizeof(measured_string_t);
     75        new->value = ((uint8_t *) new) + sizeof(measured_string_t);
    7676        // append terminating zero explicitly - to be safe
    7777        memcpy(new->value, string, new->length);
     
    9797        new = (measured_string_t *) malloc(sizeof(measured_string_t));
    9898        if (new) {
    99                 new->value = (char *) malloc(source->length + 1);
     99                new->value = (uint8_t *) malloc(source->length + 1);
    100100                if (new->value) {
    101101                        new->length = source->length;
     
    131131 */
    132132int
    133 measured_strings_receive(measured_string_t **strings, char **data,
     133measured_strings_receive(measured_string_t **strings, uint8_t **data,
    134134    size_t count)
    135135{
     
    137137        size_t index;
    138138        size_t length;
    139         char *next;
     139        uint8_t *next;
    140140        ipc_callid_t callid;
    141141        int rc;
     
    311311 */
    312312int
    313 measured_strings_return(int phone, measured_string_t **strings, char **data,
     313measured_strings_return(int phone, measured_string_t **strings, uint8_t **data,
    314314    size_t count)
    315315{
    316316        size_t *lengths;
    317317        size_t index;
    318         char *next;
     318        uint8_t *next;
    319319        int rc;
    320320
Note: See TracChangeset for help on using the changeset viewer.