Browse code

Shut up a few warnings and fix some typoes

git-svn: trunk@3214

aCaB authored on 2007/09/13 20:26:26
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Sep 13 12:37:26 CEST 2007 (acab)
2
+------------------------------------
3
+  * libclamav: Shut up a few warnings and fix some typoes
4
+
1 5
 Wed Sep 12 13:36:37 BST 2007 (njh)
2 6
 ----------------------------------
3 7
   * libclamav:	More optimisations
... ...
@@ -36,6 +36,7 @@
36 36
 #include "nsis_zlib.h"
37 37
 #include "matcher.h"
38 38
 #include "scanners.h"
39
+#include "nulsft.h" /* SHUT UP GCC -Wextra */
39 40
 
40 41
 #ifndef O_BINARY
41 42
 #define O_BINARY 0
... ...
@@ -468,11 +469,11 @@ static int nsis_headers(struct nsis_st *n, cli_ctx *ctx) {
468 468
 
469 469
 
470 470
 
471
-int cli_nsis_unpack(struct nsis_st *n, cli_ctx *ctx) {
471
+static int cli_nsis_unpack(struct nsis_st *n, cli_ctx *ctx) {
472 472
   return (n->fno) ? nsis_unpack_next(n, ctx) : nsis_headers(n, ctx);
473 473
 }
474 474
 
475
-void cli_nsis_free(struct nsis_st *n) {
475
+static void cli_nsis_free(struct nsis_st *n) {
476 476
   nsis_shutdown(n);
477 477
   if (n->solid && n->freeme) free(n->freeme);
478 478
 }
... ...
@@ -320,7 +320,6 @@ int cli_scanpe(int desc, cli_ctx *ctx)
320 320
 	struct stat sb;
321 321
 	char sname[9], buff[4096], epbuff[4096], *tempfile;
322 322
 	uint32_t epsize;
323
-	unsigned char *ubuff;
324 323
 	ssize_t bytes;
325 324
 	unsigned int i, found, upx_success = 0, min = 0, max = 0, err;
326 325
 	unsigned int ssize = 0, dsize = 0, dll = 0, pe_plus = 0;
... ...
@@ -873,11 +872,11 @@ int cli_scanpe(int desc, cli_ctx *ctx)
873 873
     }
874 874
 
875 875
     /* Kriz */
876
-    if(SCAN_ALGO && (DCONF & PE_CONF_KRIZ) && epsize >= 200 && CLI_ISCONTAINED(exe_sections[nsections - 1].raw, exe_sections[nsections - 1].rsz, ep, 0x0fd2) && epbuff[1]=='\x9c' || epbuff[2]=='\x60') {
876
+    if(SCAN_ALGO && (DCONF & PE_CONF_KRIZ) && epsize >= 200 && CLI_ISCONTAINED(exe_sections[nsections - 1].raw, exe_sections[nsections - 1].rsz, ep, 0x0fd2) && epbuff[1]=='\x9c' && epbuff[2]=='\x60') {
877 877
 	enum {KZSTRASH,KZSCDELTA,KZSPDELTA,KZSGETSIZE,KZSXORPRFX,KZSXOR,KZSDDELTA,KZSLOOP,KZSTOP};
878 878
 	uint8_t kzs[] = {KZSTRASH,KZSCDELTA,KZSPDELTA,KZSGETSIZE,KZSTRASH,KZSXORPRFX,KZSXOR,KZSTRASH,KZSDDELTA,KZSTRASH,KZSLOOP,KZSTOP};
879 879
 	uint8_t *kzstate = kzs;
880
-	uint8_t *kzcode = epbuff + 3;
880
+	uint8_t *kzcode = (uint8_t *)epbuff + 3;
881 881
 	uint8_t kzdptr=0xff, kzdsize=0xff;
882 882
 	int kzlen = 197, kzinitlen=0xffff, kzxorlen=-1;
883 883
 	cli_dbgmsg("in kriz\n");
... ...
@@ -1124,7 +1123,7 @@ int cli_scanpe(int desc, cli_ctx *ctx)
1124 1124
 	    }
1125 1125
 
1126 1126
 	    if((bytes = read(desc, src + dsize, exe_sections[i + 1].rsz)) != exe_sections[i + 1].rsz) {
1127
-	        cli_dbgmsg("MEW: Can't read %d bytes [readed: %d]\n", exe_sections[i + 1].rsz, bytes);
1127
+	        cli_dbgmsg("MEW: Can't read %d bytes [read: %d]\n", exe_sections[i + 1].rsz, bytes);
1128 1128
 		free(exe_sections);
1129 1129
 		free(src);
1130 1130
 		return CL_EIO;
... ...
@@ -1361,7 +1360,7 @@ int cli_scanpe(int desc, cli_ctx *ctx)
1361 1361
 
1362 1362
 	int sectcnt = 0;
1363 1363
 	char *support;
1364
-	uint32_t newesi, newedi, newebx, oldep, gp, t;
1364
+	uint32_t newesi, newedi, oldep, gp, t;
1365 1365
 	struct cli_exe_section *sections;
1366 1366
 
1367 1367
 	ssize = exe_sections[i + 1].rsz;