search for: clear_temp

Displaying 1 result from an estimated 1 matches for "clear_temp".

2020 Mar 28
0
[klibc:update-dash] Implement stpcpy() and stpncpy()
...s/stpcpy.c b/usr/klibc/tests/stpcpy.c new file mode 100644 index 00000000..4340f61a --- /dev/null +++ b/usr/klibc/tests/stpcpy.c @@ -0,0 +1,75 @@ +#include <stdio.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +int main(void) +{ + char temp[10]; +#define clear_temp() strcpy(temp, "XXXXXXXXX") + char *end; + + printf("stpcpy:\n"); + + clear_temp(); + end = stpcpy(temp, "123"); + printf("'%s'len:%zu strlen:%zu\n", temp, end - temp, strlen(temp)); + if (end != temp + 3 || memcmp(temp, "123\0XXXXX", 10)) +...