Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bn_mp_read_radix.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* SPDX-License-Identifier: Unlicense
*/

#define MP_TOUPPER(c) ((c) >= 'a' && (c) <= 'z' ? (c) + 'A' - 'a' : (c))

/* read a string [ASCII] in a given radix */
int mp_read_radix(mp_int *a, const char *str, int radix)
{
Expand Down Expand Up @@ -46,7 +48,7 @@ int mp_read_radix(mp_int *a, const char *str, int radix)
* this allows numbers like 1AB and 1ab to represent the same value
* [e.g. in hex]
*/
ch = (radix <= 36) ? (char)toupper((int)*str) : *str;
ch = (radix <= 36) ? (char)MP_TOUPPER((int)*str) : *str;
pos = (unsigned)(ch - '(');
if (mp_s_rmap_reverse_sz < pos) {
break;
Expand Down
1 change: 0 additions & 1 deletion tommath_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#define TOMMATH_PRIV_H_

#include "tommath.h"
#include <ctype.h>

#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
Expand Down