diff options
Diffstat (limited to 'main/glib/strncmp.c')
-rw-r--r-- | main/glib/strncmp.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/main/glib/strncmp.c b/main/glib/strncmp.c index fba4854..eca1520 100644 --- a/main/glib/strncmp.c +++ b/main/glib/strncmp.c @@ -1,6 +1,6 @@ /* * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,14 +40,16 @@ int strncmp(const char *s1, const char *s2, size_t n) { - if (n == 0) - return (0); - do { - if (*s1 != *s2++) - return (*(const unsigned char *)s1 - - *(const unsigned char *)(s2 - 1)); - if (*s1++ == '\0') - break; - } while (--n != 0); - return (0); + if(n == 0) { + return (0); + } + do { + if(*s1 != *s2++) + return (*(const unsigned char *)s1 - + *(const unsigned char *)(s2 - 1)); + if(*s1++ == '\0') { + break; + } + } while(--n != 0); + return (0); } |