Add missing definition of _C99_SOURCE
This commit is contained in:
parent
5ff33a73d8
commit
ecd0459782
3 changed files with 4 additions and 4 deletions
|
@ -61,8 +61,7 @@ cfw_strdup(const char *s)
|
|||
if ((copy = malloc(len + 1)) == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy(copy, s, len);
|
||||
copy[len] = 0;
|
||||
memcpy(copy, s, len + 1);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define _C99_SOURCE
|
||||
#define _POSIX_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -70,9 +70,9 @@ main()
|
|||
array = cfw_create(cfw_array,
|
||||
cfw_create(cfw_string, "Hallo"),
|
||||
cfw_create(cfw_string, " Welt"),
|
||||
cfw_create(cfw_string, "!"), NULL);
|
||||
cfw_create(cfw_string, "!"), (void*)NULL);
|
||||
|
||||
str = cfw_new(cfw_string, NULL);
|
||||
str = cfw_new(cfw_string, (void*)NULL);
|
||||
|
||||
for (i = 0; i < cfw_array_size(array); i++)
|
||||
cfw_string_append(str, cfw_array_get(array, i));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue