Substitute "int" type usage with "size_t" as needed. Possible bugs on ia64/x86-64 platforms (no exploit, however). Contact me for slightly patched version.