C++ 安全拼接字符串函数
void SafeStrAppend(char buf[], const uint32_t maxBufSize, uint32_t &offset, const char *format, ...) { if (offset < maxBufSize) { va_list ap; va_start(ap, format); offset += vsprintf(buf + offset, format, ap); va_end(ap); } }
void SafeStrAppend(char buf[], const uint32_t maxBufSize, uint32_t &offset, const char *format, ...) { if (offset < maxBufSize) { va_list ap; va_start(ap, format); offset += vsprintf(buf + offset, format, ap); va_end(ap); } }