Changed CRYPTMAN to use lua_pushlstring for its hashes and uuids because they have embedded zeros.

This commit is contained in:
Kyzentun Keeslala
2015-07-16 16:12:46 -06:00
parent e81ebfb5c5
commit ffc0c0ecb2
+5 -5
View File
@@ -455,35 +455,35 @@ public:
{
RString md5out;
md5out = p->GetMD5ForString(SArg(1));
lua_pushstring( L, md5out );
lua_pushlstring(L, md5out, md5out.size());
return 1;
}
static int MD5File( T* p, lua_State *L )
{
RString md5fout;
md5fout = p->GetMD5ForFile(SArg(1));
lua_pushstring( L, md5fout );
lua_pushlstring(L, md5fout, md5fout.size());
return 1;
}
static int SHA1String( T* p, lua_State *L )
{
RString sha1out;
sha1out = p->GetSHA1ForString(SArg(1));
lua_pushstring( L, sha1out );
lua_pushlstring(L, sha1out, sha1out.size());
return 1;
}
static int SHA1File( T* p, lua_State *L )
{
RString sha1fout;
sha1fout = p->GetSHA1ForFile(SArg(1));
lua_pushstring( L, sha1fout );
lua_pushlstring(L, sha1fout, sha1fout.size());
return 1;
}
static int GenerateRandomUUID( T* p, lua_State *L )
{
RString uuidOut;
uuidOut = p->GenerateRandomUUID();
lua_pushstring( L, uuidOut );
lua_pushlstring(L, uuidOut, uuidOut.size());
return 1;
}