improve table sorting, partial fix bnc #885278

```L'\0'``` is a bit confusing here. The pointer should be set to 0 or nullptr.