summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c9
-rw-r--r--source3/lib/util.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 81e9a6679a..f6b916881b 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -116,6 +116,15 @@ int sys_unlink(char *fname)
/*******************************************************************
+random number generator
+********************************************************************/
+unsigned int sys_random(int max_range)
+{
+ return(((unsigned int)random()) % max_range);
+}
+
+
+/*******************************************************************
a simple open() wrapper
********************************************************************/
int sys_open(char *fname,int flags,int mode)
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 31ad3da31c..86b0016dd2 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -598,7 +598,7 @@ char *StrCpy(char *dest,char *src)
/****************************************************************************
line strncpy but always null terminates. Make sure there is room!
****************************************************************************/
-char *StrnCpy(char *dest,const char *src,int n)
+char *StrnCpy(char *dest,char *src,int n)
{
char *d = dest;
if (!dest) return(NULL);