diff options
author | marha <marha@users.sourceforge.net> | 2012-04-16 09:37:37 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-04-16 09:43:48 +0200 |
commit | 00eae6f01bf11ec6a90dfc68e607b6a1a250a118 (patch) | |
tree | b814d518076840b7433d02bc3b5957c1dd54de25 /xorg-server/os | |
parent | a50d2ee664302147942dd5ed6428f9bab9d4e76a (diff) | |
parent | d6d3999ccb2cb72d55820770260172eccbbb68d7 (diff) | |
download | vcxsrv-00eae6f01bf11ec6a90dfc68e607b6a1a250a118.tar.gz vcxsrv-00eae6f01bf11ec6a90dfc68e607b6a1a250a118.tar.bz2 vcxsrv-00eae6f01bf11ec6a90dfc68e607b6a1a250a118.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/Xext/securitysrv.h
xorg-server/glx/glxext.h
xorg-server/glx/indirect_reqsize.c
xorg-server/glx/indirect_size_get.c
xorg-server/hw/xwin/winclip.c
xorg-server/hw/xwin/winfont.c
xorg-server/hw/xwin/winglobals.c
xorg-server/hw/xwin/winglobals.h
xorg-server/hw/xwin/winmonitors.h
xorg-server/include/closestr.h
xorg-server/include/pixmapstr.h
xorg-server/include/servermd.h
xorg-server/include/site.h
xorg-server/include/windowstr.h
xorg-server/include/xkbstr.h
Diffstat (limited to 'xorg-server/os')
-rw-r--r-- | xorg-server/os/strcasecmp.c | 4 | ||||
-rw-r--r-- | xorg-server/os/strcasestr.c | 28 | ||||
-rw-r--r-- | xorg-server/os/strlcat.c | 117 | ||||
-rw-r--r-- | xorg-server/os/strndup.c | 18 |
4 files changed, 83 insertions, 84 deletions
diff --git a/xorg-server/os/strcasecmp.c b/xorg-server/os/strcasecmp.c index cf100baf4..2692f7f1e 100644 --- a/xorg-server/os/strcasecmp.c +++ b/xorg-server/os/strcasecmp.c @@ -38,7 +38,7 @@ int xstrcasecmp(const char *str1, const char *str2) { - const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2; + const u_char *us1 = (const u_char *) str1, *us2 = (const u_char *) str2; while (tolower(*us1) == tolower(*us2)) { if (*us1++ == '\0') @@ -55,7 +55,7 @@ int xstrncasecmp(const char *s1, const char *s2, size_t n) { if (n != 0) { - const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2; + const u_char *us1 = (const u_char *) s1, *us2 = (const u_char *) s2; do { if (tolower(*us1) != tolower(*us2++)) diff --git a/xorg-server/os/strcasestr.c b/xorg-server/os/strcasestr.c index a20a6cc33..1ca2ad6bb 100644 --- a/xorg-server/os/strcasestr.c +++ b/xorg-server/os/strcasestr.c @@ -45,20 +45,20 @@ char * xstrcasestr(const char *s, const char *find) { - char c, sc; - size_t len; + char c, sc; + size_t len; - if ((c = *find++) != 0) { - c = tolower((unsigned char)c); - len = strlen(find); - do { - do { - if ((sc = *s++) == 0) - return NULL; - } while ((char)tolower((unsigned char)sc) != c); - } while (strncasecmp(s, find, len) != 0); - s--; - } - return ((char *)s); + if ((c = *find++) != 0) { + c = tolower((unsigned char) c); + len = strlen(find); + do { + do { + if ((sc = *s++) == 0) + return NULL; + } while ((char) tolower((unsigned char) sc) != c); + } while (strncasecmp(s, find, len) != 0); + s--; + } + return ((char *) s); } #endif diff --git a/xorg-server/os/strlcat.c b/xorg-server/os/strlcat.c index e374e2908..316dfa9d1 100644 --- a/xorg-server/os/strlcat.c +++ b/xorg-server/os/strlcat.c @@ -1,59 +1,58 @@ -/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <sys/types.h>
-#include <string.h>
-#include "os.h"
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat(char *dst, const char *src, size_t siz)
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
- size_t dlen;
-
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
- n--;
- }
- s++;
- }
- *d = '\0';
-
- return(dlen + (s - src)); /* count does not include NUL */
-}
+/* + * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE + * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <sys/types.h> +#include <string.h> +#include "os.h" + +/* + * Appends src to string dst of size siz (unlike strncat, siz is the + * full size of dst, not space left). At most siz-1 characters + * will be copied. Always NUL terminates (unless siz <= strlen(dst)). + * Returns strlen(src) + MIN(siz, strlen(initial dst)). + * If retval >= siz, truncation occurred. + */ +size_t +strlcat(char *dst, const char *src, size_t siz) +{ + register char *d = dst; + register const char *s = src; + register size_t n = siz; + size_t dlen; + + /* Find the end of dst and adjust bytes left but don't go past end */ + while (n-- != 0 && *d != '\0') + d++; + dlen = d - dst; + n = siz - dlen; + + if (n == 0) + return (dlen + strlen(s)); + while (*s != '\0') { + if (n != 1) { + *d++ = *s; + n--; + } + s++; + } + *d = '\0'; + + return (dlen + (s - src)); /* count does not include NUL */ +} diff --git a/xorg-server/os/strndup.c b/xorg-server/os/strndup.c index d405c789f..e0eddf13d 100644 --- a/xorg-server/os/strndup.c +++ b/xorg-server/os/strndup.c @@ -39,15 +39,15 @@ char * strndup(const char *str, size_t n) { - size_t len; - char *copy; + size_t len; + char *copy; - for (len = 0; len < n && str[len]; len++) - continue; + for (len = 0; len < n && str[len]; len++) + continue; - if ((copy = malloc(len + 1)) == NULL) - return (NULL); - memcpy(copy, str, len); - copy[len] = '\0'; - return (copy); + if ((copy = malloc(len + 1)) == NULL) + return (NULL); + memcpy(copy, str, len); + copy[len] = '\0'; + return (copy); } |