MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / string_resize

Function string_resize

samples/cgpu/cgpu-basic/mandelbrot/lodepng.c:280–289  ·  view source on GitHub ↗

returns 1 if success, 0 if failure ==> nothing done*/

Source from the content-addressed store, hash-verified

278#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
279/*returns 1 if success, 0 if failure ==> nothing done*/
280static unsigned string_resize(char** out, size_t size)
281{
282 char* data = (char*)lodepng_realloc(*out, size + 1);
283 if(data)
284 {
285 data[size] = 0; /*null termination char*/
286 *out = data;
287 }
288 return data != 0;
289}
290
291/*init a {char*, size_t} pair for use as string*/
292static void string_init(char** out)

Callers 2

string_initFunction · 0.85
string_setFunction · 0.85

Calls 1

lodepng_reallocFunction · 0.85

Tested by

no test coverage detected