OK, committed with simplification and variable name changes.
In this code
const std::string bmString = buff.isReadOnly ? "1" : "0";
if (bmString.length()) {
propKey = IndexPropKey("buffer", i, "readonly");
fprintf(sessionFile, "%s=%s\n", propKey.c_str(), bmString.c_str());
}
bmString is always a single character string ("1" or "0") so there is no need to test its length. Any failure will throw an exception and no current C++ standard library implementation will throw due to the small string optimization.
Neil