aboutsummaryrefslogtreecommitdiff
path: root/misc.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-09-20 12:55:16 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-09-20 12:55:16 +0200
commiteb447c7ff965abe92bf49dbf404447b1808322c0 (patch)
tree9309e6614f23cc5cda6042e685b24eaa0a6b5522 /misc.cc
parent7a04ee7dd3fad10e30581d22956234aeff2b2f3a (diff)
parenta57ed65f90c2ffda245c93aaa4aa710b605550d7 (diff)
downloadlibnitrokey-eb447c7ff965abe92bf49dbf404447b1808322c0.tar.gz
libnitrokey-eb447c7ff965abe92bf49dbf404447b1808322c0.tar.bz2
Merge branch 'windows_MSVC2017' into OSX_merge_cleaned
Diffstat (limited to 'misc.cc')
-rw-r--r--misc.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/misc.cc b/misc.cc
index 24f8514..d7278da 100644
--- a/misc.cc
+++ b/misc.cc
@@ -39,20 +39,20 @@ namespace misc {
};
#include <cctype>
-::std::string hexdump(const char *p, size_t size, bool print_header,
+::std::string hexdump(const uint8_t *p, size_t size, bool print_header,
bool print_ascii, bool print_empty) {
::std::stringstream out;
char formatbuf[128];
- const char *pstart = p;
+ const uint8_t *pstart = p;
- for (const char *pend = p + size; p < pend;) {
+ for (const uint8_t *pend = p + size; p < pend;) {
if (print_header){
snprintf(formatbuf, 128, "%04x\t", static_cast<int> (p - pstart));
out << formatbuf;
}
- const char* pp = p;
- for (const char *le = p + 16; p < le; p++) {
+ const uint8_t* pp = p;
+ for (const uint8_t *le = p + 16; p < le; p++) {
if (p < pend){
snprintf(formatbuf, 128, "%02x ", uint8_t(*p));
out << formatbuf;
@@ -63,8 +63,8 @@ namespace misc {
}
if(print_ascii){
- out << "\t";
- for (const char *le = pp + 16; pp < le && pp < pend; pp++) {
+ out << " ";
+ for (const uint8_t *le = pp + 16; pp < le && pp < pend; pp++) {
if (std::isgraph(*pp))
out << uint8_t(*pp);
else