[common] fix gcc format-truncation false positive

This commit is contained in:
Geoffrey McRae
2021-02-22 01:39:28 +11:00
parent 28024de314
commit 99fc650550
2 changed files with 15 additions and 4 deletions

View File

@@ -20,6 +20,10 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef _H_LG_COMMON_STRINGUTILS
#define _H_LG_COMMON_STRINGUTILS
// vsprintf but with buffer allocation
int valloc_sprintf(char ** str, const char * format, va_list ap)
__attribute__ ((format (printf, 2, 0)));
// sprintf but with buffer allocation
int alloc_sprintf(char ** str, const char * format, ...)
__attribute__ ((format (printf, 2, 3)));