diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-03-19 22:34:04 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-03-19 22:34:04 +0300 |
commit | 7f2d1f651ca77e472a7b66b8c0eb8dbffe94ff34 (patch) | |
tree | 52592236942e5b65ba2a945e644737d262031919 /source/blender/blenlib/BLI_blenlib.h | |
parent | 261120236b1c07d6c17d210f9012fb85bafe5497 (diff) |
==== blenlib ====
- added replacement BLI_snprintf for snprintf to avoid MSVC specific #defines for snprintf.
- BLI_snprintf also ensures trailing zero, so helps preventing buffer overflows
Diffstat (limited to 'source/blender/blenlib/BLI_blenlib.h')
-rw-r--r-- | source/blender/blenlib/BLI_blenlib.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 7b60aa178a7..464b851413f 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -69,6 +69,8 @@ because fillfacebase and fillvertbase are used outside */ #include "DNA_listBase.h" +#include <stdlib.h> + extern ListBase fillfacebase; extern ListBase fillvertbase; /** @@ -196,6 +198,11 @@ char* BLI_strdupn(char *str, int len); */ char* BLI_strncpy(char *dst, const char *src, int maxncpy); + /* + * Replacement for snprintf + */ +int BLI_snprintf(char *buffer, size_t count, const char *format, ...); + /** * Compare two strings * |