Merge change I8f657a99 into eclair

* changes:
  Avoid a crash trying to get a substring whose start is after its end.