Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.
Popular code excerpts may be moved to "Code Snippets" by the moderators.
And it works... I am not sure why I am seeing this behavior. Could someone please help me out? A string is supposed to be null terminated but why am I required to test for a \r character?
Your first approach seems to be the most correct to me. You're testing for null termination, which is the standard way of tearing through a string as far as i can tell. I would investigate the function you are using to tool the pointer *p. Your lcdputstr() function seems to be correct. I'm not sure where to troubleshoot from here. If you can attach the complete code you are writing, I'll throw it into gcc and see if I can help you come up with a solution...