Felipe Contreras <felipe.contreras@xxxxxxxxx> 于2021年5月31日周一 下午11:41写道: > > ZheNing Hu via GitGitGadget wrote: > > From: ZheNing Hu <adlternative@xxxxxxxxx> > > > +static int memcasecmp(const void *vs1, const void *vs2, size_t n) > > +{ > > + const char *s1 = (const void *)vs1; > > + const char *s2 = (const void *)vs2; > > As I explained in another mail, I think this is better: > > const char *s1 = vs1, *s2 = vs2; > OK, I understand it now. > > + const char *end = s1 + n; > > + > > + for (; s1 < end; s1++, s2++) { > > + int diff = tolower(*s1) - tolower(*s2); > > + if (diff) > > + return diff; > > + } > > + return 0; > > +} > > -- > Felipe Contreras Thanks. -- ZheNing Hu