Closed atanasovdaniel closed 4 years ago
As current SQPRINTFUNCTION does formating there is no way to avoid multiple calls for formating.
May be it will be better if: 1) SQPRINTFUNCTION only prints a string (without formating). 2) Have a function to do formating in memory (may be in scratch pad). 3) Have a wrapper that does formating and calls SQPRINTFUNCTION.
In current implementation string "dest" is used as "format string" in call to "printfunc". This leads to unpredictable behavior if something like format string is produced by "sqstd_format". For example string "%%s" once formated results in "%s", passed to "printfunc" will try to read two integer arguments (which are not given).
Quick test: sq>printf("%%s") %s