blob: b4bfc96e6cf9c4008e1d2e1dbc125676979ab5c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice-E is licensed to you under the terms described in the
// ICEE_LICENSE file included in this distribution.
//
// **********************************************************************
#include <IceE/DisableWarnings.h>
#include <IceE/SafeStdio.h>
#include <stdarg.h>
#include <stdio.h>
using namespace std;
string
Ice::printfToString(const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
char buf[1024];
#if defined(_WIN32)
_vsnprintf(buf, sizeof(buf)-1, fmt, ap);
#else
vsnprintf(buf, sizeof(buf)-1, fmt, ap);
#endif
buf[sizeof(buf)-1] = '\0';
va_end(ap);
return buf;
}
|