106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
if ((*string = malloc(bufferLength)) == NULL)
return -1;
length = vsnprintf(*string, bufferLength - 1, format,
arguments);
if (length > 0 && (size_t)length < bufferLength - 1)
break;
if (bufferLength > INT_MAX / 2) {
free(*string);
return -1;
}
|
|
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
if ((*string = malloc(bufferLength)) == NULL)
return -1;
length = vsnprintf(*string, bufferLength - 1, format,
arguments);
if (length >= 0 && (size_t)length < bufferLength - 1)
break;
if (bufferLength > INT_MAX / 2) {
free(*string);
return -1;
}
|