summaryrefslogtreecommitdiff
path: root/src/main/Coord.c
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-21 15:45:18 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-21 15:45:18 +0000
commitbb33d1c59a192f00d4b9b6723d00f2c93332c946 (patch)
tree50063f54f8db6c6d281b9762e4cf1338b92a7c92 /src/main/Coord.c
parentc2bebfe4964c4c7fd6ffe194c77687ee8b5f1d5a (diff)
Use strlen instead of sizeof when allocating memory for printing error msgs.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@979 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Coord.c')
-rw-r--r--src/main/Coord.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/Coord.c b/src/main/Coord.c
index e6076196..19fe8bc0 100644
--- a/src/main/Coord.c
+++ b/src/main/Coord.c
@@ -115,7 +115,7 @@ int CCTK_RegisterCoordI(int dir, int index, const char*name)
{
/* Method already exists. */
char *msg;
- msg = (char *)malloc(200*sizeof(char)+sizeof(name));
+ msg = (char *)malloc(200*sizeof(char)+strlen(name));
sprintf(msg,"Coordinate with name -%s- already registered",name);
CCTK_WARN(1,msg);
if (msg) free(msg);
@@ -257,7 +257,7 @@ int CCTKi_CoordHandle(const char *name)
else
{
char *msg;
- msg = (char *)malloc( 100*sizeof(char)+sizeof(name) );
+ msg = (char *)malloc( 100*sizeof(char)+strlen(name) );
sprintf(msg,"Could not find registered coordinate %s",name);
CCTK_WARN(2,msg);
if (msg) free(msg);
@@ -283,7 +283,7 @@ struct Coordprops *CCTKi_CoordData(const char *name)
else
{
char *msg;
- msg = (char *)malloc( 100*sizeof(char)+sizeof(name) );
+ msg = (char *)malloc( 100*sizeof(char)+strlen(name) );
sprintf(msg,"Could not find registered coordinate %s",name);
CCTK_WARN(2,msg);
if (msg) free(msg);
@@ -309,7 +309,7 @@ int CCTK_CoordIndex(const char *name)
else
{
char *msg;
- msg = (char *)malloc( 100*sizeof(char)+sizeof(name) );
+ msg = (char *)malloc( 100*sizeof(char)+strlen(name) );
sprintf(msg,"Could not find registered coordinate %s",name);
CCTK_WARN(2,msg);
if (msg) free(msg);
@@ -343,7 +343,7 @@ CCTK_REAL CCTK_CoordOrigin(const char *name)
else
{
char *msg;
- msg = (char *)malloc( 100*sizeof(char)+sizeof(name) );
+ msg = (char *)malloc( 100*sizeof(char)+strlen(name) );
sprintf(msg,"Could not find registered coordinate %s",name);
CCTK_WARN(2,msg);
if (msg) free(msg);