When compiling the application in Visual Studio 2017 - the output log displays errors with the content as below:
warning: flag '0' results in undefined behavior with 's' conversion specifier [-Wformat]
printf("[ERROR] START/END IsGreater %064s \n", maxKey.GetBase16().c_str());
~^~~~
warning: flag '0' results in undefined behavior with 's' conversion specifier [-Wformat]
printf("[load] start=%064s \n", bc->ksStart.GetBase16().c_str());
~^~~~
warning: flag '0' results in undefined behavior with 's' conversion specifier [-Wformat]
printf("[load] next=%064s \n", bc->ksNext.GetBase16().c_str());
~^~~~
warning: flag '0' results in undefined behavior with 's' conversion specifier [-Wformat]
printf("[load] end=%064s \n", bc->ksFinish.GetBase16().c_str());
~^~~~
warning: flag '0' results in undefined behavior with 's' conversion specifier [-Wformat]
fprintf(f, "Priv (HEX): 0x%064s\n", pAddrHex.c_str());
~^~~~
warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
lambda.SetBase16("5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72");
How should it look correct to eliminate existing problems?
Here are the parts cut from the source code of the file in question:
void checkKeySpace(BITCRACK_PARAM * bc, Int& maxKey) {
if (bc->ksStart.IsGreater(&maxKey) || bc->ksFinish.IsGreater(&maxKey)) {
printf("[ERROR] START/END IsGreater %064s \n", maxKey.GetBase16().c_str());
exit(-1);
}
if (bc->ksFinish.IsLowerOrEqual(&bc->ksStart)) {
printf("[ERROR] END IsLowerOrEqual START \n");
exit(-1);
}
if (bc->ksFinish.IsLowerOrEqual(&bc->ksNext)) {
printf("[ERROR] END: IsLowerOrEqual NEXT \n");
exit(-1);
}
return;
}
void reconstructAdd(Secp256K1 *secp, string fileName, string outputFile, string privAddr) {
bool compressed;
int addrType;
Int lambda;
Int lambda2;
lambda.SetBase16("5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72");
lambda2.SetBase16("ac9c52b33fa3cf1f5ad9e3fd77ed9ba4a880b9fc8ec739c2e0cfc810b51283ce");
Int privKey = secp->DecodePrivateKey((char *)privAddr.c_str(),&compressed);
if(privKey.IsNegative())
exit(-1);