> maybe the print() function should cope with \0 bytes in the string. > that would make these kind of issues more obvious. There's a power patch for that: http://lua-users.org/files/wiki_insecure/power_patches/5.1/print_nuls.patch