Skip to content

Commit

Permalink
chore(printf): make pointer var const
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaland committed Jan 31, 2019
1 parent 80b42fe commit 8f302bf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions printf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
// \author (c) Marco Paland ([email protected])
// 2014-2018, PALANDesign Hannover, Germany
// 2014-2019, PALANDesign Hannover, Germany
//
// \license The MIT License (MIT)
//
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8f302bf

Please sign in to comment.