Explorar o código

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

Alex
Alexander Neundorf %!s(int64=16) %!d(string=hai) anos
pai
achega
91fec6d89c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Source/cmFileCommand.cxx

+ 1 - 1
Source/cmFileCommand.cxx

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