diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-04-03 23:38:24 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-04-03 23:38:24 +0000 |
commit | b917f979ea34027ffdcd8bef96b84dc650153131 (patch) | |
tree | 8089763bb2acca2c8380ed5c8a133238d855422b /src/util | |
parent | 76434b7d126c7adfe43151a2cae8680f0433b29a (diff) |
Check that the first string isn't null in CCTK_Equals
git-svn-id: http://svn.cactuscode.org/flesh/trunk@431 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Misc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/Misc.c b/src/util/Misc.c index a8ef9cb9..7dab703f 100644 --- a/src/util/Misc.c +++ b/src/util/Misc.c @@ -99,8 +99,18 @@ int CCTK_Equals(const char *string1, const char *string2) { int retval; int position; + char *message; retval = 1; + + /* Check that string1 isn't null */ + if (!string1 && string2) + { + message = (char *)malloc((100+sizeof(string2))*sizeof(char)); + sprintf(message,"First string null in CCTK_Equals (2nd is %s)",string2); + CCTK_Warn(0,message); + } + if(strlen(string1)==strlen(string2)) { for(position = 0; position < strlen(string1);position++) |