Changeset 5733:a0c8a7be1ae7 in roaraudio for libroar
- Timestamp:
- 11/07/12 13:15:42 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/buffer.c
r5720 r5733 163 163 } 164 164 165 int roar_buffer_new_str (struct roar_buffer ** buf, const char * str, int terminate) { 166 size_t len; 167 void * data; 168 169 if ( buf == NULL || str == NULL ) { 170 roar_err_set(ROAR_ERROR_FAULT); 171 return -1; 172 } 173 174 len = roar_mm_strlen(str); 175 if ( terminate ) 176 len++; 177 178 if ( roar_buffer_new_data(buf, len, &data) == -1 ) 179 return -1; 180 181 if ( len ) 182 memcpy(data, str, len); 183 return 0; 184 } 185 165 186 int roar_buffer_ref (struct roar_buffer * buf) { 166 187 _ckbuf(0)
Note: See TracChangeset
for help on using the changeset viewer.