summaryrefslogtreecommitdiff
path: root/src/main/CommandLine.c
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-06-05 13:00:49 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-06-05 13:00:49 +0000
commitb2b70c8f08ddaf26ca01462f84bdb9ceeb865ee7 (patch)
tree5d2a64215f53cb62e08b6f4eb1733b90ef0f60b3 /src/main/CommandLine.c
parent52a549e7de62d72555cd32c7bf0e086e9052285e (diff)
When creating the output file names for the "-r" options, use %u
(unsigned int) instead of %d (signed int) to prevent a (theoretical) buffer overflow on 32 bit machines. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4073 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/CommandLine.c')
-rw-r--r--src/main/CommandLine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c
index e74db302..5897800a 100644
--- a/src/main/CommandLine.c
+++ b/src/main/CommandLine.c
@@ -442,13 +442,13 @@ void CCTKi_CommandLineRedirect (const char *argument)
{
if (!argument || strchr(argument,'o')) /* redirect stdout */
{
- sprintf (fname, "CCTK_Proc%d.out", myproc);
+ sprintf (fname, "CCTK_Proc%u.out", myproc);
freopen (fname, "w", stdout);
already_redirected_stdout = 1;
}
if (argument && strchr(argument,'e')) /* redirect stderr */
{
- sprintf (fname, "CCTK_Proc%d.err", myproc);
+ sprintf (fname, "CCTK_Proc%u.err", myproc);
freopen (fname, "w", stderr);
}
}