mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-20 05:37:57 +00:00
Varargs and strbuf fixes
Add missing va_end() for all va_copy() strbuf_sprintf() adds precautionary nul to end of string after vsnprintf()
This commit is contained in:
parent
3866352340
commit
29502d8c81
@ -376,6 +376,7 @@ int cli_printf(const char *fmt, ...)
|
||||
} else
|
||||
#endif
|
||||
ret = vfprintf(stdout, fmt, ap2);
|
||||
va_end(ap2);
|
||||
va_end(ap);
|
||||
return ret;
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ int form_rhizome_datastore_path(char * buf, size_t bufsiz, const char *fmt, ...)
|
||||
va_list ap2;
|
||||
va_copy(ap2, ap);
|
||||
strbuf_sprintf(b, fmt, ap2);
|
||||
va_end(ap2);
|
||||
va_end(ap);
|
||||
if (strbuf_overrun(b)) {
|
||||
WHY("Path buffer overrun");
|
||||
@ -158,6 +159,7 @@ long long sqlite_exec_int64(char *sqlformat,...)
|
||||
|
||||
vsnprintf(sqlstatement,8192,sqlformat,ap2); sqlstatement[8191]=0;
|
||||
|
||||
va_end(ap2);
|
||||
va_end(ap);
|
||||
|
||||
sqlite3_stmt *statement;
|
||||
|
Loading…
Reference in New Issue
Block a user