From 96911b50d13c608e5fd933abc77bad6d478c92f9 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Mon, 5 Nov 2007 18:48:55 +0000 Subject: [PATCH] Remove printf I should have removed before committing git-svn: trunk@3358 --- libclamav/vba_extract.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/libclamav/vba_extract.c b/libclamav/vba_extract.c index 7f50ebd6a..2557deff5 100644 --- a/libclamav/vba_extract.c +++ b/libclamav/vba_extract.c @@ -1168,26 +1168,21 @@ wm_skip_macro_extnames(int fd) offset_end += size; while(lseek(fd, 0, SEEK_CUR) < offset_end) { uint8_t length; + off_t offset; if (cli_readn(fd, &length, 1) != 1) { cli_dbgmsg("read macro_extnames failed\n"); return FALSE; } - if(is_unicode) { - if(lseek(fd, SEEK_CUR, (length * 2) + 1) == -1) { - cli_dbgmsg("read macro_extname failed\n"); - return FALSE; - } - } else if(length > 0) { - if(lseek(fd, SEEK_CUR, length) == -1) { - cli_dbgmsg("read macro_extname failed\n"); - return FALSE; - } - } - /* numref */ - if(lseek(fd, sizeof(uint16_t), SEEK_CUR) == -1) { - cli_dbgmsg("read macro_extnames failed\n"); + if(is_unicode) + offset = length * 2 + 1; + else + offset = length; + + offset += sizeof(uint16_t); /* numref */ + if(lseek(fd, offset, SEEK_CUR) == -1) { + cli_dbgmsg("read macro_extnames failed to seek\n"); return FALSE; } } @@ -1315,7 +1310,6 @@ vba_project_t *wm_dir_read(const char *dir) close(fd); return NULL; } -printf(">>>>>>>>>>>>>> 0x%x\n", info_id); switch (info_id) { case 0x01: macro_info = wm_read_macro_info(fd);