summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/split.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-04-11 15:26:58 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-04-11 15:26:58 +0200
commit6b36c7ab225c4619dcb5ac33c34813a66277457e (patch)
tree51fe970d770cd4ad794b6aa428560f020f0f0fd6 /src/tools/split.c
parentc334fda9a9da652bcac871f3b778ba4ca967031c (diff)
cstr() - > c_str() as preparation for move to std::string (nw)
Diffstat (limited to 'src/tools/split.c')
-rw-r--r--src/tools/split.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/tools/split.c b/src/tools/split.c
index 02e546fce14..ec4a5434fcc 100644
--- a/src/tools/split.c
+++ b/src/tools/split.c
@@ -123,16 +123,16 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi
filerr = core_fopen(splitfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile);
if (filerr != FILERR_NONE)
{
- fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.cstr());
+ fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.c_str());
goto cleanup;
}
// write the basics out
- core_fprintf(splitfile, "splitfile=%s\n", basefilename.cstr());
+ core_fprintf(splitfile, "splitfile=%s\n", basefilename.c_str());
core_fprintf(splitfile, "splitsize=%d\n", splitsize);
- printf("Split file is '%s'\n", splitfilename.cstr());
- printf("Splitting file %s into chunks of %dMB...\n", basefilename.cstr(), splitsize / (1024 * 1024));
+ printf("Split file is '%s'\n", splitfilename.c_str());
+ printf("Splitting file %s into chunks of %dMB...\n", basefilename.c_str(), splitsize / (1024 * 1024));
// now iterate until done
for (partnum = 0; partnum < 1000; partnum++)
@@ -150,7 +150,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi
compute_hash_as_string(computedhash, splitbuffer, length);
// write that info to the split file
- core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.cstr(), basefilename.cstr(), partnum);
+ core_fprintf(splitfile, "hash=%s file=%s.%03d\n", computedhash.c_str(), basefilename.c_str(), partnum);
// compute the full filename for this guy
outfilename.printf("%s.%03d", basename, partnum);
@@ -160,11 +160,11 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi
if (filerr != FILERR_NONE)
{
printf("\n");
- fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.cstr());
+ fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.c_str());
goto cleanup;
}
- printf(" writing %s.%03d...", basefilename.cstr(), partnum);
+ printf(" writing %s.%03d...", basefilename.c_str(), partnum);
// write the data
actual = core_fwrite(outfile, splitbuffer, length);
@@ -273,7 +273,7 @@ static int join_file(const char *filename, const char *outname, int write_output
{
core_fclose(outfile);
outfile = NULL;
- fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.cstr());
+ fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.c_str());
goto cleanup;
}
@@ -281,12 +281,12 @@ static int join_file(const char *filename, const char *outname, int write_output
filerr = core_fopen(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile);
if (filerr != FILERR_NONE)
{
- fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.cstr());
+ fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.c_str());
goto cleanup;
}
}
- printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.cstr());
+ printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", outfilename.c_str());
// now iterate through each file
while (core_fgets(buffer, sizeof(buffer), splitfile))
@@ -302,7 +302,7 @@ static int join_file(const char *filename, const char *outname, int write_output
expectedhash.cpy(buffer + 5, SHA1_DIGEST_SIZE * 2);
infilename.cpy(buffer + 5 + SHA1_DIGEST_SIZE * 2 + 6).trimspace();
- printf(" Reading file '%s'...", infilename.cstr());
+ printf(" Reading file '%s'...", infilename.c_str());
// read the file's contents
infilename.ins(0, basepath);
@@ -310,7 +310,7 @@ static int join_file(const char *filename, const char *outname, int write_output
if (filerr != FILERR_NONE)
{
printf("\n");
- fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.cstr());
+ fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.c_str());
goto cleanup;
}
@@ -321,7 +321,7 @@ static int join_file(const char *filename, const char *outname, int write_output
if (computedhash != expectedhash)
{
printf("\n");
- fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n Expected: %s\n Computed: %s\n", infilename.cstr(), expectedhash.cstr(), computedhash.cstr());
+ fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n Expected: %s\n Computed: %s\n", infilename.c_str(), expectedhash.c_str(), computedhash.c_str());
goto cleanup;
}