git-svn: trunk@207
Tomasz Kojm authored on 2004/01/26 06:06:56... | ... |
@@ -57,7 +57,7 @@ int main(int argc, char **argv) |
57 | 57 |
if(setrlimit(RLIMIT_CORE, &rlim) < 0) |
58 | 58 |
perror("setrlimit"); |
59 | 59 |
#endif |
60 |
- opt=(struct optstruct*)mcalloc(sizeof(struct optstruct)); |
|
60 |
+ opt=(struct optstruct*)mcalloc(1, sizeof(struct optstruct)); |
|
61 | 61 |
opt->optlist = NULL; |
62 | 62 |
opt->filename = NULL; |
63 | 63 |
|
66 | 66 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,52 @@ |
0 |
+/* |
|
1 |
+ * Copyright (C) 2004 Tomasz Kojm <tkojm@clamav.net> |
|
2 |
+ * |
|
3 |
+ * Based on zzip-stdint.h |
|
4 |
+ * |
|
5 |
+ * This program is free software; you can redistribute it and/or modify |
|
6 |
+ * it under the terms of the GNU General Public License as published by |
|
7 |
+ * the Free Software Foundation; either version 2 of the License, or |
|
8 |
+ * (at your option) any later version. |
|
9 |
+ * |
|
10 |
+ * This program is distributed in the hope that it will be useful, |
|
11 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
+ * GNU General Public License for more details. |
|
14 |
+ * |
|
15 |
+ * You should have received a copy of the GNU General Public License |
|
16 |
+ * along with this program; if not, write to the Free Software |
|
17 |
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
18 |
+ */ |
|
19 |
+ |
|
20 |
+#ifndef __CLTYPES_H |
|
21 |
+#define __CLTYPES_H |
|
22 |
+ |
|
23 |
+#ifdef HAVE_STDINT_H |
|
24 |
+#include <stdint.h> |
|
25 |
+#elif defined HAVE_SYS_INT_TYPES_H /*solaris*/ |
|
26 |
+#include <sys/int_types.h> |
|
27 |
+#elif defined HAVE_INTTYPES_H /*freebsd*/ |
|
28 |
+#include <inttypes.h> |
|
29 |
+#else |
|
30 |
+ typedef unsigned char uint8_t; typedef signed char int8_t; |
|
31 |
+ |
|
32 |
+# if SIZEOF_INT == 2 |
|
33 |
+ typedef unsigned int uint16_t; typedef signed int int16_t; |
|
34 |
+# elif SIZEOF_SHORT == 2 |
|
35 |
+ typedef unsigned short uint16_t; typedef signed short int16_t; |
|
36 |
+# else |
|
37 |
+# error unable to typedef int16_t from either int or short |
|
38 |
+ typedef unsigned short uint16_t; typedef signed short int16_t; |
|
39 |
+# endif |
|
40 |
+ |
|
41 |
+# if defined SIZEOF_INT == 4 |
|
42 |
+ typedef unsigned int uint32_t; typedef signed int int32_t; |
|
43 |
+# elif defined SIZEOF_LONG == 4 |
|
44 |
+ typedef unsigned long uint32_t; typedef signed long int32_t; |
|
45 |
+# else |
|
46 |
+# error unable to typedef int32_t from either int or long |
|
47 |
+ typedef unsigned long uint32_t; typedef signed long int32_t; |
|
48 |
+# endif |
|
49 |
+#endif |
|
50 |
+ |
|
51 |
+#endif |