Use snprintf
parent
a611d607b3
commit
f3284a9d81
|
@ -71,9 +71,9 @@ void LabeledSymbol::print(const std::string& s) const {
|
|||
|
||||
/* ************************************************************************* */
|
||||
LabeledSymbol::operator std::string() const {
|
||||
char buf[100];
|
||||
sprintf(buf, "%c%c%zu", c_, label_, j_);
|
||||
return std::string(buf);
|
||||
char buffer[100];
|
||||
snprintf(buffer, 100, "%c%c%llu", c_, label_, j_);
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <list>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <cstdio>
|
||||
|
||||
namespace gtsam {
|
||||
|
||||
|
@ -55,9 +56,9 @@ bool Symbol::equals(const Symbol& expected, double tol) const {
|
|||
}
|
||||
|
||||
Symbol::operator std::string() const {
|
||||
char buf[10];
|
||||
sprintf(buf, "%c%zu", c_, j_);
|
||||
return std::string(buf);
|
||||
char buffer[10];
|
||||
snprintf(buffer, 10, "%c%llu", c_, j_);
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
static Symbol make(gtsam::Key key) { return Symbol(key);}
|
||||
|
|
Loading…
Reference in New Issue