diff options
author | Ed Sutter <edsutterjr@gmail.com> | 2015-08-03 21:35:50 -0400 |
---|---|---|
committer | Ed Sutter <edsutterjr@gmail.com> | 2015-08-03 21:35:50 -0400 |
commit | a7b6f00b72c1147f29214f27285832a9b6214cd6 (patch) | |
tree | 7d4e14e9b271497a22d169013c28178d28f90257 /main/glib/strstr.c | |
parent | fix incorred verbose help text (diff) | |
download | umon-a7b6f00b72c1147f29214f27285832a9b6214cd6.tar.bz2 |
tree cleanup using 'astyle --unpad-paren --align-pointer=name --lineend=linux --add-brackets --convert-tabs --style=knf -A4 FILENAME'
Diffstat (limited to 'main/glib/strstr.c')
-rw-r--r-- | main/glib/strstr.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/main/glib/strstr.c b/main/glib/strstr.c index 22f4835..cd3922f 100644 --- a/main/glib/strstr.c +++ b/main/glib/strstr.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. @@ -45,18 +45,19 @@ __FBSDID("$FreeBSD$"); char * strstr(const char *s, const char *find) { - char c, sc; - size_t len; + char c, sc; + size_t len; - if ((c = *find++) != '\0') { - len = strlen(find); - do { - do { - if ((sc = *s++) == '\0') - return (NULL); - } while (sc != c); - } while (strncmp(s, find, len) != 0); - s--; - } - return ((char *)s); + if((c = *find++) != '\0') { + len = strlen(find); + do { + do { + if((sc = *s++) == '\0') { + return (NULL); + } + } while(sc != c); + } while(strncmp(s, find, len) != 0); + s--; + } + return ((char *)s); } |