fix bugs

https://obsproject.com/mantis/view.php?id=83
ttps://obsproject.com/mantis/view.php?id=82
1.) It would appear that you are not familiar with linux-style kernel normal form.  We do not name functions/variables/etc with CamelCase, we use underscore.
2.) You're declaring the functions above where they're used, and then defining the functions below where they're used.  There is no need to do that, just simply define them above where they're used so declarations are not needed.
3.) The functions are not static.  Functions that are not static will be external and visible to the entire module, which pollutes the global namespace and puts more unnecessary load on the compiler.
4.) There is little purpose of passing in a function callback here.  This function is only ever used once.  You may as well just write a function to simply remove carriage returns.