summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteveBroshar <steve@palmerwirelessmedtech.com>2023-10-08 15:47:22 -0500
committerSteveBroshar <steve@palmerwirelessmedtech.com>2023-10-08 15:47:22 -0500
commit7d0bcc892ec8517c4d97c605711e9a5cd43c23d8 (patch)
tree9002beaab52a658200d6833d9f83d924cd7b8a56
parentdcef17bf4336228a860bebb97f33232cd32ad55a (diff)
downloadThrowTheSwitch-Unity-7d0bcc892ec8517c4d97c605711e9a5cd43c23d8.tar.gz
use null check instead of pointer compar
-rw-r--r--src/unity.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/unity.c b/src/unity.c
index b6c08b7..e455f57 100644
--- a/src/unity.c
+++ b/src/unity.c
@@ -1609,8 +1609,8 @@ void UnityAssertEqualString(const char* expected,
}
}
else
- { /* handle case of one pointers being null (if both null, test should pass) */
- if (expected != actual)
+ { /* fail if either null but not if both */
+ if (expected || actual)
{
Unity.CurrentTestFailed = 1;
}
@@ -1649,8 +1649,8 @@ void UnityAssertEqualStringLen(const char* expected,
}
}
else
- { /* handle case of one pointers being null (if both null, test should pass) */
- if (expected != actual)
+ { /* fail if either null but not if both */
+ if (expected || actual)
{
Unity.CurrentTestFailed = 1;
}