mirror of
https://github.com/json-c/json-c.git
synced 2026-03-29 01:49:06 +08:00
clang-format the files
This commit is contained in:
@@ -18,25 +18,36 @@ static int vasprintf(char **buf, const char *fmt, va_list ap)
|
||||
int chars;
|
||||
char *b;
|
||||
|
||||
if(!buf) { return -1; }
|
||||
if (!buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
chars = _vscprintf(fmt, ap)+1;
|
||||
#else /* !defined(WIN32) */
|
||||
chars = _vscprintf(fmt, ap) + 1;
|
||||
#else /* !defined(WIN32) */
|
||||
/* CAW: RAWR! We have to hope to god here that vsnprintf doesn't overwrite
|
||||
* our buffer like on some 64bit sun systems.... but hey, its time to move on
|
||||
*/
|
||||
chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap)+1;
|
||||
if(chars < 0) { chars *= -1; } /* CAW: old glibc versions have this problem */
|
||||
chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap) + 1;
|
||||
if (chars < 0)
|
||||
{
|
||||
chars *= -1;
|
||||
} /* CAW: old glibc versions have this problem */
|
||||
#endif /* defined(WIN32) */
|
||||
|
||||
b = (char*)malloc(sizeof(char)*chars);
|
||||
if(!b) { return -1; }
|
||||
b = (char *)malloc(sizeof(char) * chars);
|
||||
if (!b)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((chars = vsprintf(b, fmt, ap)) < 0)
|
||||
if ((chars = vsprintf(b, fmt, ap)) < 0)
|
||||
{
|
||||
free(b);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
*buf = b;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user