fixed parsing, replaced bzero and bcopy with memset and memcpy

bzero() and bcopy() are deprecated.  I put parsing in it's own function for future extensibility.  I also changed the error function to be prototyped so it can be easily called by other functions if needed in the future.  I suggest moving all the networking into its own thread/functions and having the user interface in a separate thread/set of functions.