runestrchr.c 192 B

12345678910111213141516171819
  1. #include "lib9.h"
  2. Rune*
  3. runestrchr(Rune *s, Rune c)
  4. {
  5. Rune c0 = c;
  6. Rune c1;
  7. if(c == 0) {
  8. while(*s++)
  9. ;
  10. return s-1;
  11. }
  12. while(c1 = *s++)
  13. if(c1 == c0)
  14. return s-1;
  15. return 0;
  16. }