RhostMUSH / trunk

RhostMUSH 4.0: This is the official main repository of RhostMUSH. Visit us at rhostdev.mushpark.com 4201
23 stars 21 forks source link

Fix for mid lbuf reuse issue #1

Closed pdbogen closed 10 years ago

pdbogen commented 10 years ago

Something odd with mid, I'm not sure what the root cause is. This patch does not address the root cause, but it does fix the issue with mid.

The symptom is this: Occasionally, mid() called with a starting position beyond the length of the string will return recognizable text from older LBUFs. I've added a check to mid() to handle this case. Steps to reproduce on a completely clean environment:

  1. @dol [lnum(10)]=th [iter(lnum(1000),lnum(1000),,%r)]
  2. th [mid(abc,50,50)]
pdbogen commented 10 years ago

Code was fixed w/o pull.