[Libreoffice-commits] .: sal/osl

Michael Stahl mst at kemper.freedesktop.org
Thu Jan 5 04:20:26 PST 2012


 sal/osl/w32/security.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 8b898fb94ead6f698b2e2a0b551cf78c6bd62512
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 5 13:18:25 2012 +0100

    sal: try to fix MinGW min/max breakage by inlining

diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index 053d39f..2ae8685 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -368,12 +368,14 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
                 DWORD dwSidRev=SID_REVISION;
                 DWORD dwCounter;
                 DWORD dwSidSize;
+                PUCHAR pSSACount;
 
                 /* obtain SidIdentifierAuthority */
                 psia=GetSidIdentifierAuthority(pSid);
 
                 /* obtain sidsubauthority count */
-                dwSubAuthorities=min(*GetSidSubAuthorityCount(pSid), 5);
+                pSSACount = GetSidSubAuthorityCount(pSid);
+                dwSubAuthorities = (*pSSACount < 5) ? *pSSACount : 5;
 
                 /* buffer length: S-SID_REVISION- + identifierauthority- + subauthorities- + NULL */
                 Ident=malloc(88*sizeof(sal_Char));
@@ -424,7 +426,10 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
             sal_Unicode     *Ident;
 
             WNetGetUserA(NULL, NULL, &needed);
-            needed = max( 16 , needed );
+            if (needed < 16)
+            {
+                needed = 16;
+            }
             Ident=malloc(needed*sizeof(sal_Unicode));
 
             if (WNetGetUserW(NULL, Ident, &needed) != NO_ERROR)


More information about the Libreoffice-commits mailing list