git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1255 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2005/01/19 09:02:27... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Wed Jan 19 00:58:40 CET 2005 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * libclamav/str.c: cli_memstr: fix casting on 64bit platforms (thanks to |
|
4 |
+ Carlo Marcelo Arenas Belon <carenas*sajinet.com.pe>) |
|
5 |
+ |
|
1 | 6 |
Wed Jan 19 00:48:48 CET 2005 (tk) |
2 | 7 |
--------------------------------- |
3 | 8 |
* improve OS/2 support (patch by Yuri Dario <mc6530*mclink.it>) |
... | ... |
@@ -270,7 +270,7 @@ char *cli_strtokbuf(const char *input, int fieldno, const char *delim, char *out |
270 | 270 |
return output; |
271 | 271 |
} |
272 | 272 |
|
273 |
-char *cli_memstr(const char *haystack, int hs, const char *needle, int ns) |
|
273 |
+const char *cli_memstr(const char *haystack, int hs, const char *needle, int ns) |
|
274 | 274 |
{ |
275 | 275 |
const char *pt, *hay; |
276 | 276 |
int n; |
... | ... |
@@ -289,7 +289,7 @@ char *cli_memstr(const char *haystack, int hs, const char *needle, int ns) |
289 | 289 |
n = hs; |
290 | 290 |
|
291 | 291 |
while((pt = memchr(hay, needle[0], n)) != NULL) { |
292 |
- n -= (int) pt - (int) hay; |
|
292 |
+ n -= (int) (pt - hay); |
|
293 | 293 |
if(n < ns) |
294 | 294 |
break; |
295 | 295 |
|
... | ... |
@@ -26,6 +26,6 @@ short int *cli_hex2si(const char *hex); |
26 | 26 |
char *cli_hex2str(const char *hex); |
27 | 27 |
char *cli_str2hex(const char *string, unsigned int len); |
28 | 28 |
char *cli_strtokbuf(const char *input, int fieldno, const char *delim, char *output); |
29 |
-char *cli_memstr(const char *haystack, int hs, const char *needle, int ns); |
|
29 |
+const char *cli_memstr(const char *haystack, int hs, const char *needle, int ns); |
|
30 | 30 |
|
31 | 31 |
#endif |