I came across the following code which is basically just a strcmp implementation.
It never stops to amaze me in how many different ways algorithms are implemented in CCode:int compare_name(const char *p,const char *q) { int d; for (;(d=tolower(*p)-tolower(*q))==0;++p,++q) { if (!*p) break; } return d; }
What do you think of this code? it has UB? it works nice?