Comment on Ask HN: Favorite pointer tricks in C?parentComments−mrb15yYou have a bug in strlen: for(cur=str; cur; ++cur); should be: for(cur=str; *cur; ++cur);−Locke168915yRight you are. Wrote all those in the comment block. Fixed in an edit.
Comments
You have a bug in strlen:
should be:Right you are. Wrote all those in the comment block. Fixed in an edit.