mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[BIN2C][CAT]: Use stderr for printing errors (to not mix them up with normal output that should go to stdout. This is especially needed for cat).
svn path=/trunk/; revision=66947
This commit is contained in:
parent
02997eb8f4
commit
1a06e54fa5
2 changed files with 12 additions and 11 deletions
|
@ -19,7 +19,7 @@ int main(int argc, char *argv[])
|
||||||
/* Validate the arguments */
|
/* Validate the arguments */
|
||||||
if (argc < 5)
|
if (argc < 5)
|
||||||
{
|
{
|
||||||
printf("Usage: bin2c infile.bin outfile.c outfile.h array_name [array_attribute [header_for_attribute]]\n");
|
fprintf(stdout, "Usage: bin2c infile.bin outfile.c outfile.h array_name [array_attribute [header_for_attribute]]\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,14 +27,14 @@ int main(int argc, char *argv[])
|
||||||
inFile = fopen(argv[1], "rb");
|
inFile = fopen(argv[1], "rb");
|
||||||
if (!inFile)
|
if (!inFile)
|
||||||
{
|
{
|
||||||
printf("ERROR: Couldn't open data file '%s'.\n", argv[1]);
|
fprintf(stderr, "ERROR: Couldn't open data file '%s'.\n", argv[1]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
outCFile = fopen(argv[2], "w");
|
outCFile = fopen(argv[2], "w");
|
||||||
if (!outCFile)
|
if (!outCFile)
|
||||||
{
|
{
|
||||||
fclose(inFile);
|
fclose(inFile);
|
||||||
printf("ERROR: Couldn't create output source file '%s'.\n", argv[2]);
|
fprintf(stderr, "ERROR: Couldn't create output source file '%s'.\n", argv[2]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
outHFile = fopen(argv[3], "w");
|
outHFile = fopen(argv[3], "w");
|
||||||
|
@ -42,7 +42,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
fclose(outCFile);
|
fclose(outCFile);
|
||||||
fclose(inFile);
|
fclose(inFile);
|
||||||
printf("ERROR: Couldn't create output header file '%s'.\n", argv[3]);
|
fprintf(stderr, "ERROR: Couldn't create output header file '%s'.\n", argv[3]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
|
|
||||||
void help(void)
|
void help(void)
|
||||||
{
|
{
|
||||||
printf("\n"
|
fprintf(stdout,
|
||||||
|
"\n"
|
||||||
"ReactOS File Concatenation Tool\n"
|
"ReactOS File Concatenation Tool\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Usage: cat [options] [file [...]]\n"
|
"Usage: cat [options] [file [...]]\n"
|
||||||
|
@ -84,7 +85,7 @@ int main(int argc, char* argv[])
|
||||||
in = fopen(argv[i], "rb");
|
in = fopen(argv[i], "rb");
|
||||||
if (in == NULL)
|
if (in == NULL)
|
||||||
{
|
{
|
||||||
printf("Failed to open file '%s'\n", argv[i]);
|
fprintf(stderr, "Failed to open file '%s'\n", argv[i]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ int main(int argc, char* argv[])
|
||||||
*/
|
*/
|
||||||
if (!feof(in))
|
if (!feof(in))
|
||||||
{
|
{
|
||||||
printf("Error while reading file '%s'\n", argv[i]);
|
fprintf(stderr, "Error while reading file '%s'\n", argv[i]);
|
||||||
fclose(in);
|
fclose(in);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue