4 ms·
I don't think having strftime return a malloc'd pointer is a good idea. The string won't be large at all and can easily fit onto the stack (just like it was don
by atiedebee 2y ago
I don't think having strftime return a malloc'd pointer is a good idea. The string won't be large at all and can easily fit onto the stack (just like it was done in the example code). If I want to use a custom allocator to store the string, I can. If I want to malloc the string I can.