summaryrefslogtreecommitdiffstats
path: root/src/rw/NodeName.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-08-20 12:55:41 +0200
committeraap <aap@papnet.eu>2020-08-20 12:55:41 +0200
commit517e2ee9a5fa6f9100378cdcb24a3acd68c01f89 (patch)
treea194c407c50f764dc286dae851e60e4d62f53d0d /src/rw/NodeName.cpp
parentupdate librw (diff)
downloadre3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar
re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.gz
re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.bz2
re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.lz
re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.xz
re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.tar.zst
re3-517e2ee9a5fa6f9100378cdcb24a3acd68c01f89.zip
Diffstat (limited to '')
-rw-r--r--src/rw/NodeName.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rw/NodeName.cpp b/src/rw/NodeName.cpp
index ad4acffb..a7185e4f 100644
--- a/src/rw/NodeName.cpp
+++ b/src/rw/NodeName.cpp
@@ -50,8 +50,8 @@ NodeNameStreamWrite(RwStream *stream, RwInt32 binaryLength, const void *object,
RwInt32
NodeNameStreamGetSize(const void *object, RwInt32 offsetInObject, RwInt32 sizeInObject)
{
- // game checks for null pointer on node name extension but that really happen
- return (RwInt32)rwstrlen(NODENAMEEXT(object));
+ char *name = NODENAMEEXT(object); // can't be nil
+ return name ? (RwInt32)rwstrlen(name) : 0;
}
bool