--- deliantra/server/common/item.C 2007/01/15 21:06:18 1.19 +++ deliantra/server/common/item.C 2007/02/05 01:24:45 1.20 @@ -787,9 +787,10 @@ { #endif if (!plural) - strcpy (buf, op->name); + assign (buf, op->name); else - strcpy (buf, op->name_pl); + assign (buf, op->name_pl); + len = strlen (buf); #ifdef NEW_MATERIAL_CODE } @@ -803,50 +804,51 @@ switch (op->type) { - case SPELLBOOK: - case SCROLL: - case WAND: - case ROD: - if (QUERY_FLAG (op, FLAG_IDENTIFIED) || QUERY_FLAG (op, FLAG_BEEN_APPLIED)) - { - if (!op->title) - { - safe_strcat (buf, " of ", &len, MAX_BUF); - if (op->inv) - safe_strcat (buf, op->inv->name, &len, MAX_BUF); - else - LOG (llevError, "Spellbook %s lacks inventory\n", &op->name); - } - if (op->type != SPELLBOOK) - { - sprintf (buf2, " (lvl %d)", op->level); - safe_strcat (buf, buf2, &len, MAX_BUF); - } - } - break; - - - case SKILL: - case AMULET: - case RING: - if (!op->title) - { - /* If ring has a title, full description isn't so useful */ - char *s = ring_desc (op); - - if (s[0]) - { - safe_strcat (buf, " ", &len, MAX_BUF); - safe_strcat (buf, s, &len, MAX_BUF); - } - } - break; - default: - if (op->magic && ((QUERY_FLAG (op, FLAG_BEEN_APPLIED) && need_identify (op)) || QUERY_FLAG (op, FLAG_IDENTIFIED))) - { - sprintf (buf + strlen (buf), " %+d", op->magic); - } + case SPELLBOOK: + case SCROLL: + case WAND: + case ROD: + if (QUERY_FLAG (op, FLAG_IDENTIFIED) || QUERY_FLAG (op, FLAG_BEEN_APPLIED)) + { + if (!op->title) + { + safe_strcat (buf, " of ", &len, MAX_BUF); + if (op->inv) + safe_strcat (buf, op->inv->name, &len, MAX_BUF); + else + LOG (llevError, "Spellbook %s lacks inventory\n", &op->name); + } + if (op->type != SPELLBOOK) + { + sprintf (buf2, " (lvl %d)", op->level); + safe_strcat (buf, buf2, &len, MAX_BUF); + } + } + break; + + + case SKILL: + case AMULET: + case RING: + if (!op->title) + { + /* If ring has a title, full description isn't so useful */ + char *s = ring_desc (op); + + if (s[0]) + { + safe_strcat (buf, " ", &len, MAX_BUF); + safe_strcat (buf, s, &len, MAX_BUF); + } + } + break; + default: + if (op->magic && ((QUERY_FLAG (op, FLAG_BEEN_APPLIED) && need_identify (op)) || QUERY_FLAG (op, FLAG_IDENTIFIED))) + { + sprintf (buf + strlen (buf), " %+d", op->magic); + } } + return buf; }