aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_str.c')
-rw-r--r--src/microhttpd/mhd_str.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 8943b46e..d01086ac 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1073,7 +1073,7 @@ MHD_str_remove_tokens_caseless_ (char *str,
1073 while (pt < tokens_len && (' ' == t[pt] || '\t' == t[pt])) 1073 while (pt < tokens_len && (' ' == t[pt] || '\t' == t[pt]))
1074 pt++; 1074 pt++;
1075 /* Found end of the token string or non-whitespace char */ 1075 /* Found end of the token string or non-whitespace char */
1076 } while(pt < tokens_len && ',' != t[pt]); 1076 } while (pt < tokens_len && ',' != t[pt]);
1077 1077
1078 /* 'tkn' is the input token with 'tkn_len' chars */ 1078 /* 'tkn' is the input token with 'tkn_len' chars */
1079 mhd_assert (0 != tkn_len); 1079 mhd_assert (0 != tkn_len);
@@ -1531,8 +1531,10 @@ MHD_uint32_to_strx (uint32_t val,
1531 1531
1532 while (o_pos < buf_size) 1532 while (o_pos < buf_size)
1533 { 1533 {
1534 buf[o_pos++] = (digit <= 9) ? ('0' + (char) digit) : 1534 buf[o_pos++] =
1535 ('A' + (char) digit - 10); 1535 (char) ((digit <= 9) ?
1536 ('0' + (char) digit) :
1537 ('A' + (char) digit - 10));
1536 if (0 == digit_pos) 1538 if (0 == digit_pos)
1537 return o_pos; 1539 return o_pos;
1538 digit_pos--; 1540 digit_pos--;
@@ -1568,7 +1570,7 @@ MHD_uint16_to_str (uint16_t val,
1568 1570
1569 while (0 != buf_size) 1571 while (0 != buf_size)
1570 { 1572 {
1571 *chr = (char) digit + '0'; 1573 *chr = (char) ((char) digit + '0');
1572 chr++; 1574 chr++;
1573 buf_size--; 1575 buf_size--;
1574 if (1 == divisor) 1576 if (1 == divisor)
@@ -1609,7 +1611,7 @@ MHD_uint64_to_str (uint64_t val,
1609 1611
1610 while (0 != buf_size) 1612 while (0 != buf_size)
1611 { 1613 {
1612 *chr = (char) digit + '0'; 1614 *chr = (char) ((char) digit + '0');
1613 chr++; 1615 chr++;
1614 buf_size--; 1616 buf_size--;
1615 if (1 == divisor) 1617 if (1 == divisor)
@@ -1644,7 +1646,7 @@ MHD_uint8_to_str_pad (uint8_t val,
1644 } 1646 }
1645 else 1647 else
1646 { 1648 {
1647 buf[pos++] = '0' + (char) digit; 1649 buf[pos++] = (char) ('0' + (char) digit);
1648 val %= 100; 1650 val %= 100;
1649 min_digits = 2; 1651 min_digits = 2;
1650 } 1652 }
@@ -1659,13 +1661,13 @@ MHD_uint8_to_str_pad (uint8_t val,
1659 } 1661 }
1660 else 1662 else
1661 { 1663 {
1662 buf[pos++] = '0' + (char) digit; 1664 buf[pos++] = (char) ('0' + (char) digit);
1663 val %= 10; 1665 val %= 10;
1664 } 1666 }
1665 1667
1666 if (buf_size <= pos) 1668 if (buf_size <= pos)
1667 return 0; 1669 return 0;
1668 buf[pos++] = '0' + (char) val; 1670 buf[pos++] = (char) ('0' + (char) val);
1669 return pos; 1671 return pos;
1670} 1672}
1671 1673