fix #9316: when converting binary data to hex, also print the leading 0's

Alex
This commit is contained in:
Alexander Neundorf 2009-09-06 09:49:58 -04:00
parent d78e051f46
commit 91fec6d89c
1 changed files with 1 additions and 1 deletions

View File

@ -305,7 +305,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
while((sizeLimit != 0) && (c = file.get(), file)) while((sizeLimit != 0) && (c = file.get(), file))
{ {
char hex[4]; char hex[4];
sprintf(hex, "%x", c&0xff); sprintf(hex, "%.2x", c&0xff);
output += hex; output += hex;
if (sizeLimit > 0) if (sizeLimit > 0)
{ {