1 /* str.c -- strings to be used in the CoAP library
3 * Copyright (C) 2010,2011 Olaf Bergmann <bergmann@tzi.org>
5 * This file is part of the CoAP library libcoap. Please see
6 * README for terms of use.
17 str *coap_new_string(size_t size)
19 str *s = coap_malloc(sizeof(str) + size + 1);
23 coap_log(LOG_CRIT, "coap_new_string: malloc\n");
28 memset(s, 0, sizeof(str));
29 s->s = ((unsigned char *) s) + sizeof(str);
33 void coap_delete_string(str *s)