Skip to content

Commit 50c9541

Browse files
committed
chore(printf): small improvments
1 parent 3df0335 commit 50c9541

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

printf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static inline bool _is_digit(char ch)
138138

139139

140140
// internal ASCII string to unsigned int conversion
141-
static inline unsigned int _atoi(const char** str)
141+
static unsigned int _atoi(const char** str)
142142
{
143143
unsigned int i = 0U;
144144
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
172172
if ((base == 16U) && !(flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
173173
buf[len++] = 'x';
174174
}
175-
if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
175+
else if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
176176
buf[len++] = 'X';
177177
}
178-
if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
178+
else if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
179179
buf[len++] = 'b';
180180
}
181181
if (len < PRINTF_NTOA_BUFFER_SIZE) {

0 commit comments

Comments
 (0)