From 594b6bff8174d86cee0ae7ce6076754c90311814 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 19 Jul 2018 10:58:38 +0000 Subject: [PATCH] Spotted while testing under FreeBSD, needs stdio for snprintf which expects a non const pointer. --- vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm.c b/vm.c index 09a69ab..28c2915 100644 --- a/vm.c +++ b/vm.c @@ -12,6 +12,7 @@ */ /* $SymiscID: vm.c v1.4 FreeBSD 2012-09-10 00:06 stable $ */ #include "ph7int.h" +#include /* * The code in this file implements execution method of the PH7 Virtual Machine. * The PH7 compiler (implemented in 'compiler.c' and 'parse.c') generates a bytecode program @@ -10770,7 +10771,7 @@ static int vm_builtin_import(ph7_context *pCtx, int nArg, ph7_value **apArg) { /* Zero the module entry */ SyZero(&pModule, sizeof(VmModule)); SyStringInitFromBuf(&pModule.sName, zStr, nLen); - const unsigned char *file; + unsigned char *file; snprintf(file, 255, "./%s.lib", zStr); SyStringInitFromBuf(&pModule.sFile, file, nLen); pModule.pHandle = dlopen(pModule.sFile.zString, RTLD_LAZY); -- 2.43.2