also appends null termination character*/
| 322 | |
| 323 | /*also appends null termination character*/ |
| 324 | static char* alloc_string_sized(const char* in, size_t insize) { |
| 325 | char* out = (char*)lodepng_malloc(insize + 1); |
| 326 | if(out) { |
| 327 | lodepng_memcpy(out, in, insize); |
| 328 | out[insize] = 0; |
| 329 | } |
| 330 | return out; |
| 331 | } |
| 332 | |
| 333 | /* dynamically allocates a new string with a copy of the null terminated input text */ |
| 334 | static char* alloc_string(const char* in) { |
no test coverage detected