aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-09-24 17:33:05 +0200
committerMarco Paland <marco@paland.com>2018-09-24 17:33:05 +0200
commit50c954121c6c6f0a5a3dda47bea0945a2ccbe9ee (patch)
tree93d083597918c78c839848535ed267c25e1add66
parent3df03358b7482f254937aaaa1ada709df9de22aa (diff)
downloadprintf-50c954121c6c6f0a5a3dda47bea0945a2ccbe9ee.tar.gz
printf-50c954121c6c6f0a5a3dda47bea0945a2ccbe9ee.tar.bz2
printf-50c954121c6c6f0a5a3dda47bea0945a2ccbe9ee.zip
chore(printf): small improvments
-rw-r--r--printf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/printf.c b/printf.c
index d932dba..11c1f5c 100644
--- a/printf.c
+++ b/printf.c
@@ -138,7 +138,7 @@ static inline bool _is_digit(char ch)
// internal ASCII string to unsigned int conversion
-static inline unsigned int _atoi(const char** str)
+static unsigned int _atoi(const char** str)
{
unsigned int i = 0U;
while (_is_digit(**str)) {
@@ -172,10 +172,10 @@ static size_t _ntoa_format(out_fct_type out, char* buffer, size_t idx, size_t ma
if ((base == 16U) && !(flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
buf[len++] = 'x';
}
- if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
+ else if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
buf[len++] = 'X';
}
- if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
+ else if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
buf[len++] = 'b';
}
if (len < PRINTF_NTOA_BUFFER_SIZE) {