aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2019-01-31 17:58:31 +0100
committerMarco Paland <marco@paland.com>2019-01-31 17:58:31 +0100
commit8f302bfc4b23eaa89529a368dc122a98443eece8 (patch)
tree212a6658991ad5399377cdabf113d704920275e5
parent80b42fef5f070c980584b45de7b4a84322c749a0 (diff)
downloadprintf-8f302bfc4b23eaa89529a368dc122a98443eece8.tar.gz
printf-8f302bfc4b23eaa89529a368dc122a98443eece8.tar.bz2
printf-8f302bfc4b23eaa89529a368dc122a98443eece8.zip
chore(printf): make pointer var const
-rw-r--r--printf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/printf.c b/printf.c
index d73da2f..e9d714a 100644
--- a/printf.c
+++ b/printf.c
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
// \author (c) Marco Paland (info@paland.com)
-// 2014-2018, PALANDesign Hannover, Germany
+// 2014-2019, PALANDesign Hannover, Germany
//
// \license The MIT License (MIT)
//
@@ -142,8 +142,7 @@ static inline void _out_fct(char character, void* buffer, size_t idx, size_t max
// internal secure strlen
-// \return The length of the string (excluding the terminating 0)
-// limited by 'max' size if non-zero
+// \return The length of the string (excluding the terminating 0) limited by 'maxsize'
static inline unsigned int _strnlen_s(const char* str, size_t maxsize)
{
const char* s;
@@ -657,7 +656,7 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const
}
case 's' : {
- char* p = va_arg(va, char*);
+ const char* p = va_arg(va, char*);
unsigned int l = _strnlen_s(p, precision ? precision : (size_t)-1);
// pre padding
if (flags & FLAGS_PRECISION) {