git-svn: trunk@1651
Nigel Horne authored on 2005/07/17 00:53:29... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Sat Jul 16 16:52:17 BST 2005 (njh) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav/mbox.c: Fix name clash with glibc library, reported by |
|
4 |
+ Brian Bruns <bruns at 2mbit.com> |
|
5 |
+ |
|
1 | 6 |
Sat Jul 16 17:02:53 CEST 2005 (tk) |
2 | 7 |
---------------------------------- |
3 | 8 |
* libclamav/others.c: Check for 0 byte allocations in cli_(m|c|re)alloc |
... | ... |
@@ -15,7 +15,7 @@ |
15 | 15 |
* along with this program; if not, write to the Free Software |
16 | 16 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
*/ |
18 |
-static char const rcsid[] = "$Id: mbox.c,v 1.254 2005/07/08 07:31:13 nigelhorne Exp $"; |
|
18 |
+static char const rcsid[] = "$Id: mbox.c,v 1.255 2005/07/16 15:51:30 nigelhorne Exp $"; |
|
19 | 19 |
|
20 | 20 |
#if HAVE_CONFIG_H |
21 | 21 |
#include "clamav-config.h" |
... | ... |
@@ -188,7 +188,7 @@ static int rfc1341(message *m, const char *dir); |
188 | 188 |
#endif |
189 | 189 |
static bool usefulHeader(int commandNumber, const char *cmd); |
190 | 190 |
static int uufasttrack(message *m, const char *firstline, const char *dir, FILE *fin); |
191 |
-static char *getline(char *buffer, size_t len, FILE *fin); |
|
191 |
+static char *getline_from_mbox(char *buffer, size_t len, FILE *fin); |
|
192 | 192 |
|
193 | 193 |
static void checkURLs(message *m, const char *dir); |
194 | 194 |
#ifdef WITH_CURL |
... | ... |
@@ -935,7 +935,7 @@ cli_parse_mbox(const char *dir, int desc, unsigned int options) |
935 | 935 |
* Ignore any blank lines at the top of the message |
936 | 936 |
*/ |
937 | 937 |
while(strchr("\r\n", buffer[0]) && |
938 |
- (getline(buffer, sizeof(buffer) - 1, fd) != NULL)) |
|
938 |
+ (getline_from_mbox(buffer, sizeof(buffer) - 1, fd) != NULL)) |
|
939 | 939 |
; |
940 | 940 |
|
941 | 941 |
buffer[sizeof(buffer) - 1] = '\0'; |
... | ... |
@@ -1187,7 +1187,7 @@ parseEmailFile(FILE *fin, const table_t *rfc821, const char *firstLine, const ch |
1187 | 1187 |
} else |
1188 | 1188 |
if(messageAddStr(ret, line) < 0) |
1189 | 1189 |
break; |
1190 |
- } while(getline(buffer, sizeof(buffer) - 1, fin) != NULL); |
|
1190 |
+ } while(getline_from_mbox(buffer, sizeof(buffer) - 1, fin) != NULL); |
|
1191 | 1191 |
|
1192 | 1192 |
if(fullline) { |
1193 | 1193 |
if(*fullline) switch(commandNumber) { |
... | ... |
@@ -3902,7 +3902,7 @@ uufasttrack(message *m, const char *firstline, const char *dir, FILE *fin) |
3902 | 3902 |
* Like fgets but cope with end of line by "\n", "\r\n", "\n\r", "\r" |
3903 | 3903 |
*/ |
3904 | 3904 |
static char * |
3905 |
-getline(char *buffer, size_t len, FILE *fin) |
|
3905 |
+getline_from_mbox(char *buffer, size_t len, FILE *fin) |
|
3906 | 3906 |
{ |
3907 | 3907 |
char *ret; |
3908 | 3908 |
|
... | ... |
@@ -3910,7 +3910,7 @@ getline(char *buffer, size_t len, FILE *fin) |
3910 | 3910 |
return NULL; |
3911 | 3911 |
|
3912 | 3912 |
if((len == 0) || (buffer == NULL)) { |
3913 |
- cli_errmsg("Invalid call to getline(). Report to bugs@clamav.net\n"); |
|
3913 |
+ cli_errmsg("Invalid call to getline_from_mbox(). Report to bugs@clamav.net\n"); |
|
3914 | 3914 |
return NULL; |
3915 | 3915 |
} |
3916 | 3916 |
|
... | ... |
@@ -3946,12 +3946,12 @@ getline(char *buffer, size_t len, FILE *fin) |
3946 | 3946 |
|
3947 | 3947 |
if(len == 0) { |
3948 | 3948 |
/* the email probably breaks RFC821 */ |
3949 |
- cli_warnmsg("getline: buffer overflow stopped - line lost\n"); |
|
3949 |
+ cli_warnmsg("getline_from_mbox: buffer overflow stopped - line lost\n"); |
|
3950 | 3950 |
return NULL; |
3951 | 3951 |
} |
3952 | 3952 |
if(len == 1) |
3953 | 3953 |
/* over flows will have appear on separate lines */ |
3954 |
- cli_dbgmsg("getline: buffer overflow stopped - line recovered\n"); |
|
3954 |
+ cli_dbgmsg("getline_from_mbox: buffer overflow stopped - line recovered\n"); |
|
3955 | 3955 |
*buffer = '\0'; |
3956 | 3956 |
|
3957 | 3957 |
return ret; |