cast to correct type during malloc

g++ complains:

```sh
deps/str-copy/str-copy.c:15:9: error: cannot initialize a variable of type 'char *' with an rvalue of type 'void *'
  char *buf = malloc(len);
        ^     ~~~~~~~~~~~
1 error generated.
```