sal/inc/oslrandom.h    |    2 +-
 sal/osl/unx/random.cxx |    2 +-
 sal/osl/w32/random.cxx |   10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d248a7131ff495fb817cc4963298363b9e1b2008
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Sun Feb 11 11:12:57 2024 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Sun Feb 11 13:16:07 2024 +0100

    osl_get_system_random_data should return bool
    
    Change-Id: I29535d3562fe1b8d05b8df1d6c9ab83e4ead0f74
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163227
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/sal/inc/oslrandom.h b/sal/inc/oslrandom.h
index b65878433225..891277bba675 100644
--- a/sal/inc/oslrandom.h
+++ b/sal/inc/oslrandom.h
@@ -16,7 +16,7 @@
 extern "C" {
 #endif
 
-int osl_get_system_random_data(char* buffer, size_t desired_len);
+bool osl_get_system_random_data(char* buffer, size_t desired_len);
 
 #if defined __cplusplus
 }
diff --git a/sal/osl/unx/random.cxx b/sal/osl/unx/random.cxx
index e8379f8f0bf7..fbb2d7dedb90 100644
--- a/sal/osl/unx/random.cxx
+++ b/sal/osl/unx/random.cxx
@@ -14,7 +14,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-int osl_get_system_random_data(char* buffer, size_t desired_len)
+bool osl_get_system_random_data(char* buffer, size_t desired_len)
 {
     int fd;
 
diff --git a/sal/osl/w32/random.cxx b/sal/osl/w32/random.cxx
index a2c364da2ebb..27ee14fdd6d4 100644
--- a/sal/osl/w32/random.cxx
+++ b/sal/osl/w32/random.cxx
@@ -14,7 +14,7 @@
 
 #include <oslrandom.h>
 
-int osl_get_system_random_data(char* buffer, size_t desired_len)
+bool osl_get_system_random_data(char* buffer, size_t desired_len)
 {
     unsigned int val;
 
@@ -29,7 +29,7 @@ int osl_get_system_random_data(char* buffer, size_t 
desired_len)
         }
         if (rand_s(&val))
         {
-            return 0;
+            return false;
         }
         memcpy(buffer, &val, len);
         buffer += len;
@@ -40,7 +40,7 @@ int osl_get_system_random_data(char* buffer, size_t 
desired_len)
     {
         if (rand_s(reinterpret_cast<unsigned int*>(buffer)))
         {
-            return 0;
+            return false;
         }
         else
         {
@@ -53,11 +53,11 @@ int osl_get_system_random_data(char* buffer, size_t 
desired_len)
     {
         if (rand_s(&val))
         {
-            return 0;
+            return false;
         }
         memcpy(buffer, &val, desired_len);
     }
-    return 1;
+    return true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to