strcmp.c 403 B

1234567891011121314151617181920
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* return negative, zero or positive value if
  7. resp. s < t, s == t or s > t
  8. */
  9. #include "ack_string.h"
  10. int
  11. strcmp(s, t)
  12. register _CONST char *s, *t;
  13. {
  14. while (*s == *t++)
  15. if (*s++ == '\0')
  16. return 0;
  17. return *s - *--t;
  18. }