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:
chad
2013-02-15 03:58:08 +00:00
parent c303afa0a2
commit 45f85cd29d

View File

@@ -46,9 +46,10 @@ int main(int argc, char** argv) {
out << setw(4) << setfill('0') << hex << j << " : ";
for (unsigned i = 0; i < word; ++i) {
if (!in.eof()) bytes.push(in.get());
else bytes.push(0);
bytes.push(in.get());
if (in.eof()) { bytes.pop(); while(i++ < word) bytes.push(0); }
}
for (unsigned i = 0; i < word; ++i) {
out << hex << setw(2) << setfill('0') << unsigned(bytes.top());
bytes.pop();