From 6f5db32d147166ab1617c66844e3297eededc704 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <gcontini@users.noreply.github.com> Date: ćšć, 19 9æ 2019 20:20:18 +0800 Subject: [PATCH] Feature/mingw cross compile (#51) --- src/tools/bootstrap/bootstrap.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tools/bootstrap/bootstrap.cpp b/src/tools/bootstrap/bootstrap.cpp index 4af84e9..e3647de 100644 --- a/src/tools/bootstrap/bootstrap.cpp +++ b/src/tools/bootstrap/bootstrap.cpp @@ -10,7 +10,7 @@ void write_pubkey_file(const string& public_fname, const string& pbPublicKey) { FILE* fp = fopen(public_fname.c_str(), "w"); - if (fp == NULL) { + if (fp == nullptr) { throw ios_base::failure(string("can't create :") + public_fname); } fprintf(fp, "//file generated by bootstrap.cpp, do not edit.\n\n"); @@ -18,7 +18,7 @@ fprintf(fp, "#define PUBLIC_KEY { \\\n"); fprintf(fp, "%s", pbPublicKey.c_str()); fprintf(fp, "}\n\n"); - int random = rand() % 1000; + const int random = rand() % 1000; fprintf(fp, "#define SHARED_RANDOM %d;\n", random); fprintf(fp, "#endif\n"); fclose(fp); @@ -26,7 +26,7 @@ void write_privkey_file(const string& private_fname, const string& privateKey) { FILE* fp = fopen(private_fname.c_str(), "w"); - if (fp == NULL) { + if (fp == nullptr) { throw ios_base::failure(string("can't create :") + private_fname); } fprintf(fp, "//file generated by bootstrap.cpp, do not edit.\n\n"); @@ -91,8 +91,8 @@ printf("********************************************\n"); } - string private_fname = string(argv[1]); - string public_fname(argv[2]); + const string private_fname = string(argv[1]); + const string public_fname(argv[2]); if (file_exists(private_fname) || file_exists(public_fname)) { printf("Key files exist, skipping key generation. Do 'make clean' to generate new keys.\n"); -- Gitblit v1.9.1