forked from OctaForge/libcubescript
fix garbage buffers
parent
5ee9668bfc
commit
ae2a65749b
|
@ -7,13 +7,13 @@ namespace cscript {
|
||||||
CsString intstr(CsInt v) {
|
CsString intstr(CsInt v) {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
snprintf(buf, sizeof(buf), IntFormat, v);
|
snprintf(buf, sizeof(buf), IntFormat, v);
|
||||||
return buf;
|
return static_cast<char const *>(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
CsString floatstr(CsFloat v) {
|
CsString floatstr(CsFloat v) {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
snprintf(buf, sizeof(buf), v == CsInt(v) ? RoundFloatFormat : FloatFormat, v);
|
snprintf(buf, sizeof(buf), v == CsInt(v) ? RoundFloatFormat : FloatFormat, v);
|
||||||
return buf;
|
return static_cast<char const *>(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *cs_dup_ostr(ostd::ConstCharRange s) {
|
char *cs_dup_ostr(ostd::ConstCharRange s) {
|
||||||
|
|
Loading…
Reference in New Issue