Tighten rtl_{string,uString}_newFromStr_WithLength implementation

While the documented interface was already narrow (or at least didn't suggest
that the length argument could reasonably be negative), the implementation was
somewhat broader:  For one, it allowed the character pointer to be null even
when the length was non-zero, which looks more like a call-site bug than like a
useful feature.  And for another, while it did assert that the length is non-
negative, it nevertheless then checked "overly defensively" for <= 0 rather than
== 0 down the road.

Change-Id: I084148aaa4b9c4aea16729b0ce90b73ccbe73ebe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107425
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 082dcd7..bf58db0 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -1356,10 +1356,11 @@
    SAL_THROW_EXTERN_C()
{
    assert(ppThis);
    assert(pCharStr != nullptr || nLen == 0);
    assert(nLen >= 0);
    IMPL_RTL_STRINGDATA* pOrg;

    if ( !pCharStr || (nLen <= 0) )
    if ( nLen == 0 )
    {
        IMPL_RTL_STRINGNAME( new )( ppThis );
        return;