Add missing definition of _C99_SOURCE

This commit is contained in:
Jonathan Schleifer 2014-07-08 00:46:47 +02:00
parent 5ff33a73d8
commit ecd0459782
3 changed files with 4 additions and 4 deletions

View file

@ -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;
}

View file

@ -24,6 +24,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#define _C99_SOURCE
#define _POSIX_SOURCE
#include <stdio.h>

View file

@ -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));