pkgsrc/mail/elmo/patches/patch-ag
dholland 5a0c87f1f4 Don't do a global s/==/=/ in the configure script; that breaks stuff.
Patch the uses of test == instead. Fixes broken build.
Also, fix interpreter handling in the installed perl script, and
fix some 64-bit issues. Mark that destdir support works.
PKGREVISION++
2008-08-31 20:09:12 +00:00

34 lines
1.1 KiB
Text

$NetBSD: patch-ag,v 1.1 2008/08/31 20:09:12 dholland Exp $
--- src/mime.c~ 2004-08-13 07:18:22.000000000 -0400
+++ src/mime.c 2008-08-31 15:50:42.000000000 -0400
@@ -526,8 +526,9 @@ translate (struct rfc2047 *s, char *to)
{
int ret;
iconv_t id = iconv_open (to, s->charset);
- char *inptr, *outptr, *result;
- int insize, outsize, ressize;
+ const char *inptr;
+ char *outptr, *result;
+ size_t insize, outsize, ressize;
int bad_chars = 0;
if (id == (iconv_t) -1){
@@ -557,10 +558,17 @@ translate (struct rfc2047 *s, char *to)
insize--;
}
if (errno == E2BIG){
+ if (ressize * 2 > ressize) {
result = xrealloc (result, ressize * 2);
outptr += ressize - outsize;
outsize += ressize;
ressize *= 2;
+ } else {
+ /* wrong: should report overflow */
+ /* (but don't want to patch in a new message string) */
+ bad_chars++;
+ insize = 0;
+ }
}
}