add the disabling formatting coments and adjust the partial code manuly

This commit is contained in:
dota17
2020-03-27 13:04:50 +08:00
parent a8cec740f0
commit c117d8a8a8
13 changed files with 345 additions and 301 deletions

View File

@@ -124,9 +124,10 @@ int sprintbuf(struct printbuf *p, const char *msg, ...)
size = vsnprintf(buf, 128, msg, ap);
va_end(ap);
/* if string is greater than stack buffer, then use dynamic string
with vasprintf. Note: some implementation of vsnprintf return -1
if output is truncated whereas some return the number of bytes that
would have been written - this code handles both cases. */
* with vasprintf. Note: some implementation of vsnprintf return -1
* if output is truncated whereas some return the number of bytes that
* would have been written - this code handles both cases.
*/
if(size == -1 || size > 127) {
va_start(ap, msg);
if((size = vasprintf(&t, msg, ap)) < 0) { va_end(ap); return -1; }