splitobj() panic feedback
In case the splitobj() panic gets triggered again, provide some more info about why that has happened.
This commit is contained in:
@@ -458,8 +458,11 @@ splitobj(struct obj *obj, long num)
|
|||||||
{
|
{
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
|
|
||||||
|
/* can't split containers */
|
||||||
if (obj->cobj || num <= 0L || obj->quan <= num)
|
if (obj->cobj || num <= 0L || obj->quan <= num)
|
||||||
panic("splitobj"); /* can't split containers */
|
panic("splitobj [cobj=%s num=%ld quan=%ld]",
|
||||||
|
obj->cobj ? "non-empty container" : "(null)", num, obj->quan);
|
||||||
|
|
||||||
otmp = newobj();
|
otmp = newobj();
|
||||||
*otmp = *obj; /* copies whole structure */
|
*otmp = *obj; /* copies whole structure */
|
||||||
otmp->oextra = (struct oextra *) 0;
|
otmp->oextra = (struct oextra *) 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user