diff --git a/README.md b/README.md index ffd627c..744c0b0 100755 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ The [MY-BASIC Quick Reference](https://paladin-t.github.io/my_basic/MY-BASIC%20Q ## Support MY-BASIC development/List of donors -I need your supports to keep this project alive. Please consider supporting MY-BASIC development with a donation, if it's useful for you. +I need your supports to keep this project alive. Consider supporting MY-BASIC development with a donation, if it's useful for you. One-off [donation](http://paladin-t.github.io/my_basic/donate.html) via PayPal. diff --git a/core/my_basic.c b/core/my_basic.c index f4a2880..59532fa 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -11932,7 +11932,8 @@ _exit: int mb_pop_int(struct mb_interpreter_t* s, void** l, int_t* val) { int result = MB_FUNC_OK; mb_value_t arg; - int_t tmp = 0; + + if(val) *val = 0; if(!s || !l || !val) { result = MB_FUNC_ERR; @@ -11946,11 +11947,11 @@ int mb_pop_int(struct mb_interpreter_t* s, void** l, int_t* val) { switch(arg.type) { case MB_DT_INT: - tmp = arg.value.integer; + *val = arg.value.integer; break; case MB_DT_REAL: - tmp = (int_t)(arg.value.float_point); + *val = (int_t)(arg.value.float_point); break; default: @@ -11960,8 +11961,6 @@ int mb_pop_int(struct mb_interpreter_t* s, void** l, int_t* val) { goto _exit; } - *val = tmp; - _exit: return result; } @@ -11970,7 +11969,8 @@ _exit: int mb_pop_real(struct mb_interpreter_t* s, void** l, real_t* val) { int result = MB_FUNC_OK; mb_value_t arg; - real_t tmp = 0; + + if(val) *val = 0; if(!s || !l || !val) { result = MB_FUNC_ERR; @@ -11984,11 +11984,11 @@ int mb_pop_real(struct mb_interpreter_t* s, void** l, real_t* val) { switch(arg.type) { case MB_DT_INT: - tmp = (real_t)(arg.value.integer); + *val = (real_t)(arg.value.integer); break; case MB_DT_REAL: - tmp = arg.value.float_point; + *val = arg.value.float_point; break; default: @@ -11998,8 +11998,6 @@ int mb_pop_real(struct mb_interpreter_t* s, void** l, real_t* val) { goto _exit; } - *val = tmp; - _exit: return result; } @@ -12008,7 +12006,8 @@ _exit: int mb_pop_string(struct mb_interpreter_t* s, void** l, char** val) { int result = MB_FUNC_OK; mb_value_t arg; - char* tmp = 0; + + if(val) *val = 0; if(!s || !l || !val) { result = MB_FUNC_ERR; @@ -12022,7 +12021,7 @@ int mb_pop_string(struct mb_interpreter_t* s, void** l, char** val) { switch(arg.type) { case MB_DT_STRING: - tmp = arg.value.string; + *val = arg.value.string; break; default: @@ -12032,8 +12031,6 @@ int mb_pop_string(struct mb_interpreter_t* s, void** l, char** val) { goto _exit; } - *val = tmp; - _exit: return result; } @@ -12042,7 +12039,8 @@ _exit: int mb_pop_usertype(struct mb_interpreter_t* s, void** l, void** val) { int result = MB_FUNC_OK; mb_value_t arg; - void* tmp = 0; + + if(val) *val = 0; if(!s || !l || !val) { result = MB_FUNC_ERR; @@ -12056,7 +12054,7 @@ int mb_pop_usertype(struct mb_interpreter_t* s, void** l, void** val) { switch(arg.type) { case MB_DT_USERTYPE: - tmp = arg.value.usertype; + *val = arg.value.usertype; break; default: @@ -12066,8 +12064,6 @@ int mb_pop_usertype(struct mb_interpreter_t* s, void** l, void** val) { goto _exit; } - *val = tmp; - _exit: return result; }