jonathondgebhardt / advent-of-code-cpp

Advent of Code
0 stars 0 forks source link

Don't use tmpnam #14

Closed jonathondgebhardt closed 11 months ago

jonathondgebhardt commented 11 months ago

There is an edge case while using std::tmpnam and the compiler suggests using something else to mitigate this.

jonathondgebhardt commented 11 months ago

I took advantage of CURLOPT_WRITEFUNCTION and CURLOPT_WRITEDATA to write POST data to a buffer instead of writing straight to a temporary file. I tried this before, but did not handle the latter, so it kept crashing.