1 /* 2 * Copyright 2008, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT license. 4 */ 5 6 7 #include <stdbool.h> 8 #include <string.h> 9 10 11 int 12 strcmp(char const *a, char const *b) 13 { 14 while (true) { 15 int cmp = (unsigned char)*a - (unsigned char)*b++; 16 if (cmp != 0 || *a++ == '\0') 17 return cmp; 18 } 19 } 20