diff OrthancServer/LuaScripting.cpp @ 1465:905842836ad4

sample Lua script to write DICOM series to disk
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 27 Jul 2015 17:33:47 +0200
parents 68827c07e683
children f967bdf8534e
line wrap: on
line diff
--- a/OrthancServer/LuaScripting.cpp	Fri Jul 03 10:03:40 2015 +0200
+++ b/OrthancServer/LuaScripting.cpp	Mon Jul 27 17:33:47 2015 +0200
@@ -86,7 +86,7 @@
     std::string result;
     if (HttpToolbox::SimpleGet(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), uri))
     {
-      lua_pushstring(state, result.c_str());
+      lua_pushlstring(state, result.c_str(), result.size());
     }
     else
     {
@@ -133,7 +133,7 @@
         HttpToolbox::SimplePut(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
                                uri, bodyData, bodySize))
     {
-      lua_pushstring(state, result.c_str());
+      lua_pushlstring(state, result.c_str(), result.size());
     }
     else
     {