Now the final word is 0 instead of 00ff if input is smaller than memsize.
git-svn-id: http://www.cdkersey.com/harp/harptool@126 0246edb2-e076-4747-b392-db732a341fa2
This commit is contained in:
@@ -46,9 +46,10 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
out << setw(4) << setfill('0') << hex << j << " : ";
|
out << setw(4) << setfill('0') << hex << j << " : ";
|
||||||
for (unsigned i = 0; i < word; ++i) {
|
for (unsigned i = 0; i < word; ++i) {
|
||||||
if (!in.eof()) bytes.push(in.get());
|
bytes.push(in.get());
|
||||||
else bytes.push(0);
|
if (in.eof()) { bytes.pop(); while(i++ < word) bytes.push(0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < word; ++i) {
|
for (unsigned i = 0; i < word; ++i) {
|
||||||
out << hex << setw(2) << setfill('0') << unsigned(bytes.top());
|
out << hex << setw(2) << setfill('0') << unsigned(bytes.top());
|
||||||
bytes.pop();
|
bytes.pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user