diff options
author | Yang Tse <yangsita@gmail.com> | 2008-09-12 05:08:18 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-09-12 05:08:18 +0000 |
commit | 6d233becf03496e80a17317d077d48d5a51f177e (patch) | |
tree | 2d2a2f4be32bcffab33d07f69707b64adc32aa09 | |
parent | 2bcd13aaee0476a6b3e63cb600bad2dd0ca593f2 (diff) |
change CRLF into LF line endings
-rw-r--r-- | ares/ares_strdup.c | 86 | ||||
-rw-r--r-- | ares/ares_strdup.h | 54 |
2 files changed, 70 insertions, 70 deletions
diff --git a/ares/ares_strdup.c b/ares/ares_strdup.c index 284a8136b..31137a343 100644 --- a/ares/ares_strdup.c +++ b/ares/ares_strdup.c @@ -1,43 +1,43 @@ -
-/* $Id$ */
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "setup.h"
-#include "ares_strdup.h"
-
-#ifndef HAVE_STRDUP
-char *ares_strdup(const char *s1)
-{
- size_t sz;
- char * s2;
-
- if(s1) {
- sz = strlen(s1);
- if(sz < (size_t)-1) {
- sz++;
- if(sz < ((size_t)-1) / sizeof(char)) {
- s2 = malloc(sz * sizeof(char));
- if(s2) {
- memcpy(s2, s1, sz * sizeof(char));
- return s2;
- }
- }
- }
- }
- return (char *)NULL;
-}
-#endif
+ +/* $Id$ */ + +/* Copyright 1998 by the Massachusetts Institute of Technology. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in + * advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" + * without express or implied warranty. + */ + +#include "setup.h" +#include "ares_strdup.h" + +#ifndef HAVE_STRDUP +char *ares_strdup(const char *s1) +{ + size_t sz; + char * s2; + + if(s1) { + sz = strlen(s1); + if(sz < (size_t)-1) { + sz++; + if(sz < ((size_t)-1) / sizeof(char)) { + s2 = malloc(sz * sizeof(char)); + if(s2) { + memcpy(s2, s1, sz * sizeof(char)); + return s2; + } + } + } + } + return (char *)NULL; +} +#endif diff --git a/ares/ares_strdup.h b/ares/ares_strdup.h index 4a649cb25..33df619bc 100644 --- a/ares/ares_strdup.h +++ b/ares/ares_strdup.h @@ -1,27 +1,27 @@ -#ifndef HEADER_CARES_STRDUP_H
-#define HEADER_CARES_STRDUP_H
-
-/* $Id$ */
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "setup.h"
-
-#ifndef HAVE_STRDUP
-extern char *ares_strdup(const char *s1);
-#endif
-
-#endif /* HEADER_CARES_STRDUP_H */
+#ifndef HEADER_CARES_STRDUP_H +#define HEADER_CARES_STRDUP_H + +/* $Id$ */ + +/* Copyright 1998 by the Massachusetts Institute of Technology. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in + * advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" + * without express or implied warranty. + */ + +#include "setup.h" + +#ifndef HAVE_STRDUP +extern char *ares_strdup(const char *s1); +#endif + +#endif /* HEADER_CARES_STRDUP_H */ |