I have looked at the LuaJIT tutorial at: <http://luajit.org/ext_ffi_tutorial.html>

I am trying to get more into Lua and wanted to see how easy it would be for me to call a simple "lowercase" function in a "libutility.so" I have written in C.

So here is the C function I want to call:

```
void lowercase(char* str){    
    int z;    
    for (z = 0; str[z]; z++){    
      str[z] = tolower(str[ z ]);    
    }    
}

```

So now I want to call this function from Lua...here is my code using LuaJIT's FFI 

```
local ffi = require("ffi")
ffi.cdef[[
void lowercase(char* str);
]]
local utility = ffi.load("utility")    
local buf = ffi.new("char[?]", 11)
ffi.copy(buf, "HELLO WORLD")    
utility.lowercase(buf)
print("Result: ", #str)

```

The above code does not work...well I think it works until the LAST line of code above.

Can someone please give me some advise on how I can call this "lowercase" function and print out the result properly?