Commit 03ae509746d2db20b9b04ef0029d2fd3ea874124
1 parent
e0ebc6fc
br-search bug fixes
Showing
2 changed files
with
5 additions
and
3 deletions
app/br-search/br-search.cpp
| ... | ... | @@ -78,10 +78,12 @@ struct SearchResults |
| 78 | 78 | |
| 79 | 79 | static void writeMD5asHex(const unsigned char *md5) |
| 80 | 80 | { |
| 81 | + const char prevFill = cout.fill(); | |
| 81 | 82 | cout << hex << setfill('0'); |
| 82 | 83 | for (int i=0; i<16; i++) |
| 83 | - cout << setw(2) << md5[i]; | |
| 84 | + cout << setw(2) << int(md5[i]); | |
| 84 | 85 | cout << dec; |
| 86 | + setfill(prevFill); | |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | void print() |
| ... | ... | @@ -107,7 +109,7 @@ struct SearchResults |
| 107 | 109 | if (i > 0) |
| 108 | 110 | cout << ", "; |
| 109 | 111 | } |
| 110 | - cout << "]}\n" << flush; | |
| 112 | + cout << "] }\n" << flush; | |
| 111 | 113 | } |
| 112 | 114 | |
| 113 | 115 | virtual float compare(br_const_utemplate target, br_const_utemplate query) const = 0; | ... | ... |
openbr/universal_template.cpp
| ... | ... | @@ -43,7 +43,7 @@ void br_iterate_utemplates(br_const_utemplate begin, br_const_utemplate end, br_ |
| 43 | 43 | { |
| 44 | 44 | while (begin != end) { |
| 45 | 45 | callback(begin, context); |
| 46 | - begin = reinterpret_cast<br_const_utemplate>(reinterpret_cast<const char*>(begin) + sizeof(br_const_utemplate) + begin->size); | |
| 46 | + begin = reinterpret_cast<br_const_utemplate>(reinterpret_cast<const char*>(begin) + sizeof(br_universal_template) + begin->size); | |
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | ... | ... |