From 99e21288f1352dbed8feec8f8e604adb58a55331 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Mon, 23 Sep 1996 01:20:00 +0200
Subject: [PATCH] workaround for sun CC included in f_crypt

Rev: src/builtin_functions.c:1.2
---
 src/builtin_functions.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/builtin_functions.c b/src/builtin_functions.c
index 89af7fe954..0f6afcd826 100644
--- a/src/builtin_functions.c
+++ b/src/builtin_functions.c
@@ -673,8 +673,11 @@ void f_crypt(INT32 args)
       
     saltp=sp[1-args].u.string->str;
   } else {
-    salt[0] = choise[my_rand()%strlen(choise)];
-    salt[1] = choise[my_rand()%strlen(choise)];
+    unsigned int foo; /* Sun CC want's this :( */
+    foo=my_rand();
+    salt[0] = choise[foo % (unsigned int) strlen(choise)];
+    foo=my_rand();
+    salt[1] = choise[foo % (unsigned int) strlen(choise)];
     saltp=salt;
   }
 #ifdef HAVE_CRYPT
-- 
GitLab