Merge pull request #39 from iUltimateLP/master
Added handling of strings in STR() too
This commit is contained in:
commit
e5536eb091
@ -17768,6 +17768,13 @@ static int _std_str(mb_interpreter_t* s, void** l) {
|
||||
mb_realtostr(arg.value.float_point, _CHAR_BUF_PTR(buf), lbuf);
|
||||
#endif /* MB_MANUAL_REAL_FORMATTING */
|
||||
|
||||
break;
|
||||
case MB_DT_STRING:
|
||||
lbuf = strlen(arg.value.string) + 1; /* Buffer needs to be as big as the string */
|
||||
_RESIZE_CHAR_BUF(buf, lbuf);
|
||||
char* str = mb_memdup(arg.value.string, lbuf); /* Create a copy of the string */
|
||||
_CHAR_BUF_PTR(buf) = str;
|
||||
|
||||
break;
|
||||
case MB_DT_TYPE: {
|
||||
const char* sp = mb_get_type_string(arg.value.type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user