summaryrefslogtreecommitdiff
path: root/src/main/Groups.c
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-06-18 16:50:35 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-06-18 16:50:35 +0000
commitac77e4d2475cb2af898daae820a84cd9c9c2eb1a (patch)
treedd80ad6d0728178a4c3298b15608378d5acfb642 /src/main/Groups.c
parent0e452aa598d9c51535cd2a64947dc54fc6b17562 (diff)
sizeof(pointer to string) was confused with strlen (pointer) in a malloc
git-svn-id: http://svn.cactuscode.org/flesh/trunk@556 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Groups.c')
-rw-r--r--src/main/Groups.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/Groups.c b/src/main/Groups.c
index 72feff46..463cc8b5 100644
--- a/src/main/Groups.c
+++ b/src/main/Groups.c
@@ -101,7 +101,7 @@ int CCTK_GetGroupIndex(const char *fullgroupname)
else
{
char *message;
- message = (char *)malloc( (100+sizeof(fullgroupname))*sizeof(char) );
+ message = (char *)malloc( (100+strlen(fullgroupname))*sizeof(char) );
sprintf(message,"No group found with the name %s",fullgroupname);
CCTK_Warn(2,"CCTK",message);
if (message) free(message);
@@ -384,7 +384,7 @@ int CCTK_GetVarIndex(const char *variable_name)
}
else if (ierr == 1)
{
- message = (char *)malloc( (100+sizeof(variable_name))*sizeof(char) );
+ message = (char *)malloc( (100+strlen(variable_name))*sizeof(char) );
sprintf(message,"Full name %s in wrong format in CCTK_GetVarNum",
variable_name);
CCTK_Warn(2,"CCTK",message);