diff --git a/app/br-search/br-search.cpp b/app/br-search/br-search.cpp index b9b56e9..e455d5c 100644 --- a/app/br-search/br-search.cpp +++ b/app/br-search/br-search.cpp @@ -78,10 +78,12 @@ struct SearchResults static void writeMD5asHex(const unsigned char *md5) { + const char prevFill = cout.fill(); cout << hex << setfill('0'); for (int i=0; i<16; i++) - cout << setw(2) << md5[i]; + cout << setw(2) << int(md5[i]); cout << dec; + setfill(prevFill); } void print() @@ -107,7 +109,7 @@ struct SearchResults if (i > 0) cout << ", "; } - cout << "]}\n" << flush; + cout << "] }\n" << flush; } virtual float compare(br_const_utemplate target, br_const_utemplate query) const = 0; diff --git a/openbr/universal_template.cpp b/openbr/universal_template.cpp index 9b45e53..64763a4 100644 --- a/openbr/universal_template.cpp +++ b/openbr/universal_template.cpp @@ -43,7 +43,7 @@ void br_iterate_utemplates(br_const_utemplate begin, br_const_utemplate end, br_ { while (begin != end) { callback(begin, context); - begin = reinterpret_cast(reinterpret_cast(begin) + sizeof(br_const_utemplate) + begin->size); + begin = reinterpret_cast(reinterpret_cast(begin) + sizeof(br_universal_template) + begin->size); } }