MCPcopy Create free account
hub / github.com/NetHack/NetHack / safe_oname

Function safe_oname

src/do_name.c:94–100  ·  view source on GitHub ↗

safe_oname() always returns a valid pointer to * a string, either the pointer to an object's name * if it has one, or a pointer to an empty string * if it doesn't. */

Source from the content-addressed store, hash-verified

92 * if it doesn't.
93 */
94const char *
95safe_oname(struct obj *obj)
96{
97 if (has_oname(obj))
98 return ONAME(obj);
99 return "";
100}
101
102/* get a name for a monster or an object from player;
103 truncate if longer than PL_PSIZ, then return it */

Callers 7

resetobjsFunction · 0.85
do_onameFunction · 0.85
readobjnamFunction · 0.85
mergableFunction · 0.85
xkilledFunction · 0.85
discard_minventFunction · 0.85
create_objectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected