Changeset 61bfc370 in mainline for uspace/lib/c/generic/adt/measured_strings.c
- Timestamp:
- 2011-01-07T18:57:55Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e08a733
- Parents:
- 7c34b28f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/measured_strings.c
r7c34b28f r61bfc370 59 59 */ 60 60 measured_string_t * 61 measured_string_create_bulk(const char*string, size_t length)61 measured_string_create_bulk(const uint8_t *string, size_t length) 62 62 { 63 63 measured_string_t *new; … … 68 68 } 69 69 new = (measured_string_t *) malloc(sizeof(measured_string_t) + 70 (sizeof( char) * (length + 1)));70 (sizeof(uint8_t) * (length + 1))); 71 71 if (!new) 72 72 return NULL; 73 73 74 74 new->length = length; 75 new->value = (( char*) new) + sizeof(measured_string_t);75 new->value = ((uint8_t *) new) + sizeof(measured_string_t); 76 76 // append terminating zero explicitly - to be safe 77 77 memcpy(new->value, string, new->length); … … 97 97 new = (measured_string_t *) malloc(sizeof(measured_string_t)); 98 98 if (new) { 99 new->value = ( char*) malloc(source->length + 1);99 new->value = (uint8_t *) malloc(source->length + 1); 100 100 if (new->value) { 101 101 new->length = source->length; … … 131 131 */ 132 132 int 133 measured_strings_receive(measured_string_t **strings, char**data,133 measured_strings_receive(measured_string_t **strings, uint8_t **data, 134 134 size_t count) 135 135 { … … 137 137 size_t index; 138 138 size_t length; 139 char*next;139 uint8_t *next; 140 140 ipc_callid_t callid; 141 141 int rc; … … 311 311 */ 312 312 int 313 measured_strings_return(int phone, measured_string_t **strings, char**data,313 measured_strings_return(int phone, measured_string_t **strings, uint8_t **data, 314 314 size_t count) 315 315 { 316 316 size_t *lengths; 317 317 size_t index; 318 char*next;318 uint8_t *next; 319 319 int rc; 320 320
Note:
See TracChangeset
for help on using the changeset viewer.