diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-28 10:43:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-28 10:43:04 +0400 |
commit | 0b9be7059183fd7b4e8b567aeab5fec0cab1f999 (patch) | |
tree | a6b31f9422c540381e68391f3044f481358c7b38 /source/blender/blenlib/intern/string.c | |
parent | 71e7f9028f683b39fcdb0549da908751bce2e4d2 (diff) |
typo's and some style cleanup, also added asserts into BLI_vsnprintf and BLI_sprintfN when invalid args are given.
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 14e0dc2f049..f23f75f69d9 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -85,6 +85,10 @@ size_t BLI_vsnprintf(char *__restrict buffer, size_t count, const char *__restri { size_t n; + BLI_assert(buffer != NULL); + BLI_assert(count > 0); + BLI_assert(format != NULL); + n = vsnprintf(buffer, count, format, arg); if (n != -1 && n < count) { @@ -115,6 +119,8 @@ char *BLI_sprintfN(const char *__restrict format, ...) va_list arg; char *n; + BLI_assert(format != NULL); + va_start(arg, format); ds = BLI_dynstr_new(); |