| 157 | } |
| 158 | |
| 159 | void sqstd_pushstringf(HSQUIRRELVM v,const SQChar *s,...) |
| 160 | { |
| 161 | SQInteger n=256; |
| 162 | va_list args; |
| 163 | begin: |
| 164 | va_start(args,s); |
| 165 | SQChar *b=sq_getscratchpad(v,n); |
| 166 | SQInteger r=scvsprintf(b,n,s,args); |
| 167 | va_end(args); |
| 168 | if (r>=n) { |
| 169 | n=r+1;//required+null |
| 170 | goto begin; |
| 171 | } else if (r<0) { |
| 172 | sq_pushnull(v); |
| 173 | } else { |
| 174 | sq_pushstring(v,b,r); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | static SQInteger _string_printf(HSQUIRRELVM v) |
| 179 | { |
nothing calls this directly
no test coverage detected