Browse code

bb#1219

git-svn: trunk@4229

aCaB authored on 2008/10/07 22:35:21
Showing 9 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Oct  7 15:52:06 CEST 2008 (acab)
2
+------------------------------------
3
+  * misc: add missing EOL to dbg/warn messages - bb#1219
4
+
1 5
 Tue Oct  7 13:21:04 CEST 2008 (acab)
2 6
 ------------------------------------
3 7
   * libclamav/unzip.c: error path fixes, handle bzip2's deflate in a special manner - bb#1220
... ...
@@ -4796,7 +4796,7 @@ connect2clamd(struct privdata *privdata)
4796 4796
 		buf[nbytes] = '\0';
4797 4797
 #ifdef	CL_DEBUG
4798 4798
 		if(debug_level >= 4)
4799
-			cli_dbgmsg("Received: %s", buf);
4799
+			cli_dbgmsg("Received: %s\n", buf);
4800 4800
 #endif
4801 4801
 		if(sscanf(buf, "PORT %hu\n", &p) != 1) {
4802 4802
 			logg(_("!Expected port information from clamd, got '%s'\n"),
... ...
@@ -4830,7 +4830,7 @@ connect2clamd(struct privdata *privdata)
4830 4830
 		if(connect(privdata->dataSocket, (struct sockaddr *)&reply, sizeof(struct sockaddr_in)) < 0) {
4831 4831
 			perror("connect");
4832 4832
 
4833
-			cli_dbgmsg("Failed to connect to port %d given by clamd",
4833
+			cli_dbgmsg("Failed to connect to port %d given by clamd\n",
4834 4834
 				p);
4835 4835
 			/* 0.4 - use better error message */
4836 4836
 #ifdef HAVE_STRERROR_R
... ...
@@ -560,7 +560,7 @@ static int read_sys_control(int fd, chm_metadata_t *metadata, lzx_control_t *lzx
560 560
 	lzx_control->cache_size = chm_endian_convert_32(lzx_control->cache_size);
561 561
 	
562 562
 	if (strncmp((const char *) "LZXC", (const char *) lzx_control->signature, 4) != 0) {
563
-		cli_dbgmsg("bad sys_control signature");
563
+		cli_dbgmsg("bad sys_control signature\n");
564 564
 		return FALSE;
565 565
 	}
566 566
 	switch(lzx_control->version) {
... ...
@@ -912,7 +912,7 @@ int cli_chm_open(int fd, const char *dirname, chm_metadata_t *metadata)
912 912
 	
913 913
 	while (metadata->num_chunks) {
914 914
 		if (read_chunk(metadata, fd) != CL_SUCCESS) {
915
-			cli_dbgmsg("read_chunk failed");
915
+			cli_dbgmsg("read_chunk failed\n");
916 916
 			goto abort;
917 917
 		}
918 918
 		if (read_control_entries(metadata) == FALSE) {
... ...
@@ -923,7 +923,7 @@ int cli_chm_open(int fd, const char *dirname, chm_metadata_t *metadata)
923 923
 	}
924 924
 
925 925
 	if (!metadata->sys_content.length || !metadata->sys_control.length || !metadata->sys_reset.length) {
926
-		cli_dbgmsg("sys file missing");
926
+		cli_dbgmsg("sys file missing\n");
927 927
 		goto abort;
928 928
 	}
929 929
 	
... ...
@@ -313,7 +313,7 @@ static int iconv(iconv_t iconv_struct,char **inbuf, size_t *inbytesleft,
313 313
 					else if( (input[i]&0xF8) == 0xF0) {
314 314
 						if((input[i+1]&0xC0) == 0x80 && (input[i+2]&0xC0) == 0x80 && (input[i+3]&0xC0) == 0x80) {
315 315
 							/* 4 bytes long 11110www 10xxxxxx 10yyyyyy 10zzzzzz -> 000wwwxx xxxxyyyy yyzzzzzz*/
316
-							cli_dbgmsg(MODULE_NAME "UTF8 character out of UTF16 range encountered");
316
+							cli_dbgmsg(MODULE_NAME "UTF8 character out of UTF16 range encountered\n");
317 317
 							output[j++] = 0xff;
318 318
 							output[j++] = 0xff;
319 319
 
... ...
@@ -1079,7 +1079,7 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
1079 1079
 					if(dconf_js && !js_state) {
1080 1080
 						js_state = cli_js_init();
1081 1081
 						if(!js_state) {
1082
-							cli_dbgmsg("htmlnorm: Failed to initialize js parser");
1082
+							cli_dbgmsg("htmlnorm: Failed to initialize js parser\n");
1083 1083
 						}
1084 1084
 						js_begin = ptr;
1085 1085
 						js_end = NULL;
... ...
@@ -832,7 +832,7 @@ static void run_decoders(struct parser_state *state)
832 832
 		/* initialize embedded context */
833 833
 		memset(&state->tokens, 0, sizeof(state->tokens));
834 834
 		if(++state->rec > 16)
835
-			cli_dbgmsg(MODULE "recursion limit reached");
835
+			cli_dbgmsg(MODULE "recursion limit reached\n");
836 836
 		else {
837 837
 			cli_js_process_buffer(state, res.txtbuf.data, res.txtbuf.pos);
838 838
 			--state->rec;
... ...
@@ -896,7 +896,7 @@ void cli_js_output(struct parser_state *state, const char *tempdir)
896 896
 	if(buf.pos < 9 || memcmp(buf.buf + buf.pos - 9, "</script>", 9))
897 897
 		buf_outs("</script>", &buf);
898 898
 	if(write(buf.outfd, buf.buf, buf.pos) < 0) {
899
-		cli_dbgmsg(MODULE "I/O error");
899
+		cli_dbgmsg(MODULE "I/O error\n");
900 900
 	}
901 901
 	close(buf.outfd);
902 902
 	cli_dbgmsg(MODULE "dumped/appended normalized script to: %s\n",filename);
... ...
@@ -936,7 +936,7 @@ void cli_js_process_buffer(struct parser_state *state, const char *buf, size_t n
936 936
 	if(!state->global) {
937 937
 		/* this state has either not been initialized,
938 938
 		 * or cli_js_parse_done() was already called on it */
939
-		cli_warnmsg(MODULE "invalid state");
939
+		cli_warnmsg(MODULE "invalid state\n");
940 940
 		return;
941 941
 	}
942 942
 	yyb = yy_scan_bytes(buf, n, state->scanner);
... ...
@@ -2765,7 +2765,7 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2765 2765
 				}
2766 2766
 			} else if(strcasecmp(mimeSubtype, "external-body") == 0)
2767 2767
 				/* TODO */
2768
-				cli_warnmsg("Attempt to send Content-type message/external-body trapped");
2768
+				cli_warnmsg("Attempt to send Content-type message/external-body trapped\n");
2769 2769
 			else
2770 2770
 				cli_warnmsg("Unsupported message format `%s' - if you believe this file contains a virus, submit it to www.clamav.net\n", mimeSubtype);
2771 2771
 
... ...
@@ -2777,7 +2777,7 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2777 2777
 			return rc;
2778 2778
 
2779 2779
 		default:
2780
-			cli_dbgmsg("Message received with unknown mime encoding - assume application");
2780
+			cli_dbgmsg("Message received with unknown mime encoding - assume application\n");
2781 2781
 			/*
2782 2782
 			 * Some Yahoo emails attach as
2783 2783
 			 * Content-Type: X-unknown/unknown;
... ...
@@ -643,7 +643,7 @@ flatedecode(unsigned char *buf, off_t len, int fout, cli_ctx *ctx)
643 643
 
644 644
 	zstat = inflateInit(&stream);
645 645
 	if(zstat != Z_OK) {
646
-		cli_warnmsg("cli_pdf: inflateInit failed");
646
+		cli_warnmsg("cli_pdf: inflateInit failed\n");
647 647
 		return CL_EMEM;
648 648
 	}
649 649
 
... ...
@@ -516,7 +516,7 @@ int cli_scanpe(int desc, cli_ctx *ctx)
516 516
     cli_dbgmsg("NumberOfSections: %d\n", nsections);
517 517
 
518 518
     timestamp = (time_t) EC32(file_hdr.TimeDateStamp);
519
-    cli_dbgmsg("TimeDateStamp: %s", cli_ctime(&timestamp, timestr, sizeof(timestr)));
519
+    cli_dbgmsg("TimeDateStamp: %s\n", cli_ctime(&timestamp, timestr, sizeof(timestr)));
520 520
 
521 521
     cli_dbgmsg("SizeOfOptionalHeader: %x\n", EC16(file_hdr.SizeOfOptionalHeader));
522 522