util.crand: Silence compiler warning
[prosody.git] / util-src / crand.c
index 9a45f10f5daedf3fee4adbb5aa054adef2cdf0e1..fbdec8f8a4681da1d4a3536b4aae5fa6ed96ecd9 100644 (file)
@@ -23,7 +23,7 @@
  * TODO: Decide on fixed size or dynamically allocated buffer
  */
 #if 1
-#include <malloc.h>
+#include <stdlib.h>
 #else
 #define BUFLEN 256
 #endif
@@ -106,7 +106,7 @@ int Lrandom(lua_State *L) {
 
 #endif
 
-       lua_pushlstring(L, buf, ret);
+       lua_pushlstring(L, (const char *)buf, ret);
 #ifndef BUFLEN
        free(buf);
 #endif