diff options
author | Brad King <brad.king@kitware.com> | 2018-07-17 11:12:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-07-17 11:12:29 (GMT) |
commit | e08f02b9282dc8e09bfb49955806f82e1d48415c (patch) | |
tree | 7bef80cfbeafdbe31a3050c58b7a7f89917b04b1 /Source | |
parent | 689ce111a8bc20b3dfc60326b65fc03e918c9679 (diff) | |
parent | 5f431789a9b7dfcd3e350d08fb71521999d2be5c (diff) | |
download | CMake-e08f02b9282dc8e09bfb49955806f82e1d48415c.zip CMake-e08f02b9282dc8e09bfb49955806f82e1d48415c.tar.gz CMake-e08f02b9282dc8e09bfb49955806f82e1d48415c.tar.bz2 |
Merge topic 'hex_file'
5f431789a9 Use isxdigit() to determine if a character is a hex digit
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2213
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmHexFileConverter.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index 8deb8c1..4e29f39 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmHexFileConverter.h" +#include <ctype.h> #include <stdio.h> #include <string.h> @@ -12,13 +13,6 @@ #define MOTOROLA_SREC_MIN_LINE_LENGTH (2 + 2 + 4 + 2) #define MOTOROLA_SREC_MAX_LINE_LENGTH (2 + 2 + 8 + (256 * 2) + 2) -// might go to SystemTools ? -static bool cm_IsHexChar(char c) -{ - return (((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'f')) || - ((c >= 'A') && (c <= 'F'))); -} - static unsigned int ChompStrlen(const char* line) { if (line == nullptr) { @@ -169,7 +163,7 @@ cmHexFileConverter::FileType cmHexFileConverter::DetermineFileType( } for (unsigned int i = 1; i < slen; i++) { - if (!cm_IsHexChar(buf[i])) { + if (!isxdigit(buf[i])) { return Binary; } } |