rboston628 / THRAIN

The Mighty White Dwarf Code
GNU General Public License v3.0
1 stars 0 forks source link

first attempted improvement to workflow action #6

Closed rboston628 closed 1 year ago

rboston628 commented 1 year ago

Noting here for posterity, it is suspected the use of sprintf with arbitrarily chosen string buffers may have been the partial cause of the segfaults when running the clang build. Part of this PR removed all use of sprintf and replaced it with std::string methods, including a new strmakef function which makes a std::string from a format list.

// method using sprintf
char message[256];
sprintf(message, "check %d %lf", 1, sqrt(2));

// the equivalent new method
std::string message = strmakef("check %d %lf", 1, sqrt(2));

The changes have not always been uniformly applied, and some work cleaning up how strings are handled is needed in the future.