| 108 | } |
| 109 | |
| 110 | int vsnprintf(char* __restrict__ Dest, size_t Count, const char* __restrict__ Format, va_list Args) { |
| 111 | int ret = _vsnprintf(Dest, Count, Format, Args); |
| 112 | if (ret == -1) { |
| 113 | Dest[Count - 1] = '\0'; |
| 114 | return _vsnprintf(nullptr, 0, Format, Args); |
| 115 | } |
| 116 | return ret; |
| 117 | } |
| 118 | |
| 119 | int snprintf(char* stream, size_t n, const char* format, ...) { |
| 120 | __builtin_va_list args; |