Clean-up: modernize pretty_xml.cpp
[lttng-tools.git] / src / common / uuid.cpp
index ddf0fb509c9fe45fab7067820b1032e657c4e3a3..4c64c08acedafe03de2e3d32b168146b97271134 100644 (file)
@@ -27,7 +27,7 @@ bool lttng_uuid_is_init;
 
 void lttng_uuid_to_str(const lttng_uuid& uuid, char *uuid_str)
 {
-       sprintf(uuid_str, LTTNG_UUID_FMT, LTTNG_UUID_FMT_VALUES(uuid));
+       snprintf(uuid_str, LTTNG_UUID_STR_LEN, LTTNG_UUID_FMT, LTTNG_UUID_FMT_VALUES(uuid));
 }
 
 std::string lttng::utils::uuid_to_str(const lttng_uuid& uuid)
@@ -83,7 +83,7 @@ int lttng_uuid_generate(lttng_uuid& uuid_out)
        if (!lttng_uuid_is_init) {
                try {
                        srand(lttng::random::produce_best_effort_random_seed());
-               } catch (std::exception& e) {
+               } catch (const std::exception& e) {
                        ERR("Failed to initialize random seed during generation of UUID: %s",
                            e.what());
                        ret = -1;
This page took 0.023203 seconds and 4 git commands to generate.