mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-27 20:10:26 +00:00
src/common.(c|h) : Add function append_snprintf().
This commit is contained in:
parent
1028c308b2
commit
8d33a8a530
15
src/common.c
15
src/common.c
@ -1314,6 +1314,21 @@ psf_rand_int32 (void)
|
||||
return value ;
|
||||
} /* psf_rand_int32 */
|
||||
|
||||
void
|
||||
append_snprintf (char * dest, size_t maxlen, const char * fmt, ...)
|
||||
{ size_t len = strlen (dest) ;
|
||||
|
||||
if (len < maxlen)
|
||||
{ va_list ap ;
|
||||
|
||||
va_start (ap, fmt) ;
|
||||
vsnprintf (dest + len, maxlen - len, fmt, ap) ;
|
||||
va_end (ap) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* append_snprintf */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
|
@ -617,6 +617,8 @@ void psf_log_SF_INFO (SF_PRIVATE *psf) ;
|
||||
|
||||
int32_t psf_rand_int32 (void) ;
|
||||
|
||||
void append_snprintf (char * dest, size_t maxlen, const char * fmt, ...) ;
|
||||
|
||||
/* Functions used when writing file headers. */
|
||||
|
||||
int psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...) ;
|
||||
|
Loading…
Reference in New Issue
Block a user