summaryrefslogtreecommitdiff
path: root/misc.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-31 13:43:11 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-31 14:20:58 +0200
commitbf289b885768ae5db4e15e18f66390595a2b20f3 (patch)
tree65c99289e58c9492d2510a7f4d918318c71c7e10 /misc.cc
parent9892ae74c8e828d163e797b9a309972bbe8ef367 (diff)
downloadlibnitrokey-bf289b885768ae5db4e15e18f66390595a2b20f3.tar.gz
libnitrokey-bf289b885768ae5db4e15e18f66390595a2b20f3.tar.bz2
Fix compilation warnings
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'misc.cc')
-rw-r--r--misc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc.cc b/misc.cc
index 5eb81b5..0c71de2 100644
--- a/misc.cc
+++ b/misc.cc
@@ -23,7 +23,7 @@ namespace misc {
data.reserve(d_size);
char buf[2];
- for(int i=0; i<s_size; i++){
+ for(size_t i=0; i<s_size; i++){
char c = hexString[i];
bool char_from_range = (('0' <= c && c <='9') || ('A' <= c && c <= 'F') || ('a' <= c && c<= 'f'));
@@ -47,7 +47,7 @@ namespace misc {
for (const char *pend = p + size; p < pend;) {
if (print_header){
- snprintf(formatbuf, 128, "%04lx\t", p - pstart);
+ snprintf(formatbuf, 128, "%04dx\t", static_cast<int> (p - pstart));
out << formatbuf;
}