git-svn: trunk@482
Tomasz Kojm authored on 2004/04/10 06:19:011 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,55 +0,0 @@ |
1 |
-/* |
|
2 |
- * Copyright (C) 2004 Bastian Kleineidam <calvin@debian.org> |
|
3 |
- * |
|
4 |
- * This program is free software; you can redistribute it and/or modify |
|
5 |
- * it under the terms of the GNU General Public License as published by |
|
6 |
- * the Free Software Foundation; either version 2 of the License, or |
|
7 |
- * (at your option) any later version. |
|
8 |
- * |
|
9 |
- * This program is distributed in the hope that it will be useful, |
|
10 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
- * GNU General Public License for more details. |
|
13 |
- * |
|
14 |
- * You should have received a copy of the GNU General Public License |
|
15 |
- * along with this program; if not, write to the Free Software |
|
16 |
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
17 |
- */ |
|
18 |
- |
|
19 |
-#if HAVE_CONFIG_H |
|
20 |
-#include "clamav-config.h" |
|
21 |
-#endif |
|
22 |
- |
|
23 |
-#include <string.h> |
|
24 |
-#include <stdlib.h> |
|
25 |
- |
|
26 |
-#if !defined(HAVE_STRLCPY) |
|
27 |
-size_t strlcpy(char *dst, const char *src, size_t size) |
|
28 |
-{ |
|
29 |
- size_t ret = strlen(src); |
|
30 |
- |
|
31 |
- if (size) { |
|
32 |
- size_t len = (ret >= size) ? size-1 : ret; |
|
33 |
- memcpy(dst, src, len); |
|
34 |
- dst[len] = '\0'; |
|
35 |
- } |
|
36 |
- |
|
37 |
- return ret; |
|
38 |
-} |
|
39 |
-#endif |
|
40 |
- |
|
41 |
-#if !defined(HAVE_STRLCAT) |
|
42 |
-size_t strlcat(char *dst, const char *src, size_t size) |
|
43 |
-{ |
|
44 |
- size_t dst_len = strlen(dst); |
|
45 |
- size_t src_len = strlen(src); |
|
46 |
- |
|
47 |
- if (size) { |
|
48 |
- size_t len = (src_len >= size-dst_len) ? (size-dst_len-1) : src_len; |
|
49 |
- memcpy(&dst[dst_len], src, len); |
|
50 |
- dst[dst_len + len] = '\0'; |
|
51 |
- } |
|
52 |
- |
|
53 |
- return dst_len + src_len; |
|
54 |
-} |
|
55 |
-#endif |
56 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,37 +0,0 @@ |
1 |
-/* |
|
2 |
- * Copyright (C) 2004 Bastian Kleineidam <calvin@debian.org> |
|
3 |
- * |
|
4 |
- * This program is free software; you can redistribute it and/or modify |
|
5 |
- * it under the terms of the GNU General Public License as published by |
|
6 |
- * the Free Software Foundation; either version 2 of the License, or |
|
7 |
- * (at your option) any later version. |
|
8 |
- * |
|
9 |
- * This program is distributed in the hope that it will be useful, |
|
10 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
- * GNU General Public License for more details. |
|
13 |
- * |
|
14 |
- * You should have received a copy of the GNU General Public License |
|
15 |
- * along with this program; if not, write to the Free Software |
|
16 |
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
17 |
- */ |
|
18 |
- |
|
19 |
-#ifndef __STRUTIL_H |
|
20 |
-#define __STRUTIL_H |
|
21 |
- |
|
22 |
-#if HAVE_CONFIG_H |
|
23 |
-#include "clamav-config.h" |
|
24 |
-#endif |
|
25 |
- |
|
26 |
-#include <string.h> |
|
27 |
-#include <stdlib.h> |
|
28 |
- |
|
29 |
-#if !defined(HAVE_STRLCPY) |
|
30 |
-size_t strlcpy(char *dst, const char *src, size_t size); |
|
31 |
-#endif |
|
32 |
- |
|
33 |
-#if !defined(HAVE_STRLCAT) |
|
34 |
-size_t strlcat(char *dst, const char *src, size_t size); |
|
35 |
-#endif |
|
36 |
- |
|
37 |
-#endif |