differences were 32 bits -- thanks to Dean Gaudet for the patch.
+2008-04-05 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+
+ * bug #20028 (Debian bug 399271): fix code assuming that pointer
+ differences were 32 bits -- thanks to Dean Gaudet for the patch.
+
2008-01-25 Josh Bressers <josh@bress.net>
* uip/mhshowsbr.c (show_all_messages): Be more generous when parsing
|| !(cp = strchr(mbox += idx + strlen (key), '/')))
return 0;
- snprintf (buffer, buffer_len, "%*.*s", cp - mbox, cp - mbox, mbox);
+ snprintf (buffer, buffer_len, "%*.*s", (int)(cp - mbox), (int)(cp - mbox), mbox);
return 1;
}
bplen += tmplen;
#else
if (cp != file) {
- snprintf (bp, sizeof(li->curlock), "%.*s", cp - file, file);
+ snprintf (bp, sizeof(li->curlock), "%.*s", (int)(cp - file), file);
tmplen = strlen (bp);
bp += tmplen;
bplen += tmplen;
strncpy (li->tmplock, ",LCK.XXXXXX", sizeof(li->tmplock));
else
snprintf (li->tmplock, sizeof(li->tmplock), "%.*s,LCK.XXXXXX",
- cp - li->curlock, li->curlock);
+ (int)(cp - li->curlock), li->curlock);
}
#endif
}
snprintf(buffer, sizeof(buffer), "%s%s",
BACKUP_PREFIX, cp);
else
- snprintf(buffer, sizeof(buffer), "%.*s%s%s", cp - file, file,
+ snprintf(buffer, sizeof(buffer), "%.*s%s%s", (int)(cp - file), file,
BACKUP_PREFIX, cp);
unlink(buffer);
if (cp) {
/* return path for UUCP style addressing */
dp = strchr (++cp, '\n');
- snprintf (rp, rplen, "%.*s!%.*s\n", dp - cp, cp, bp - ap, ap);
+ snprintf (rp, rplen, "%.*s!%.*s\n", (int)(dp - cp), cp, (int)(bp - ap), ap);
} else {
/* return path for standard domain addressing */
- snprintf (rp, rplen, "%.*s\n", bp - ap, ap);
+ snprintf (rp, rplen, "%.*s\n", (int)(bp - ap), ap);
}
/*
if ((cp = r1bindex (file, '/')) == file)
strncpy (buffer, tmpfil, sizeof(buffer));
else
- snprintf (buffer, sizeof(buffer), "%.*s%s", cp - file, file, tmpfil);
+ snprintf (buffer, sizeof(buffer), "%.*s%s", (int)(cp - file), file, tmpfil);
unlink (buffer);
return buffer;
while (isspace (*ap))
ap++;
if (cp)
- sprintf (adr, "%.*s", cp - ap, ap);
+ sprintf (adr, "%.*s", (int)(cp - ap), ap);
else
strcpy (adr, ap);
bp = adr + strlen (adr) - 1;
name += NCWD;
if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) {
- snprintf (buffer, sizeof(buffer), "%.*s", cp - pwds, pwds);
+ snprintf (buffer, sizeof(buffer), "%.*s", (int)(cp - pwds), pwds);
return getcpy (buffer);
}
else
cp = ep;
- snprintf (buffer, sizeof(buffer), "%.*s/%s", cp - pwds, pwds, name);
+ snprintf (buffer, sizeof(buffer), "%.*s/%s", (int)(cp - pwds), pwds, name);
return getcpy (buffer);
}
while (*cp && *cp++ != '\n')
continue;
if (cp - sp)
- fprintf (tmp, "%s: %*.*s", comp, cp - sp, cp - sp, sp);
+ fprintf (tmp, "%s: %*.*s", comp, (int)(cp - sp), (int)(cp - sp), sp);
} while (*cp);
if (cp[-1] != '\n' && cp != text)
putc ('\n', tmp);
fp = strchr(ep + 1, '\n');
tp = dctime(dlocaltimenow());
snprintf (buffer, sizeof(buffer), "From %.*s %s",
- fp - ep, ep, tp);
+ (int)(fp - ep), ep, tp);
} else if (!strncmp (buffer, "X-Envelope-From:", 16)) {
/*
* Change the "X-Envelope-From:" field
if ((dp = strchr(cp = r1bindex (file, '/'), '.')) == NULL)
dp = cp + strlen (cp);
if (cp == file)
- snprintf (buffer, sizeof(buffer), ".%.*s%s", dp - cp, cp, ".map");
+ snprintf (buffer, sizeof(buffer), ".%.*s%s", (int)(dp - cp), cp, ".map");
else
snprintf (buffer, sizeof(buffer), "%.*s.%.*s%s",
- cp - file, file, dp - cp, cp, ".map");
+ (int)(cp - file), file, (int)(dp - cp), cp, ".map");
return buffer;
}
while (*cp)
cp++;
fprintf (stderr, "invalid MD5 digest (got %d octets)\n",
- cp - bp);
+ (int)(cp - bp));
}
return NOTOK;
while (*cp)
cp++;
fprintf (stderr, "invalid MD5 digest (got %d octets)\n",
- cp - bp);
+ (int)(cp - bp));
}
return NOTOK;
/* return path for UUCP style addressing */
ep = strchr(++hp, '\n');
snprintf (buffer, sizeof(buffer), "Return-Path: %.*s!%.*s\n",
- ep - hp, hp, cp - fp, fp);
+ (int)(ep - hp), hp, (int)(cp - fp), fp);
} else {
/* return path for standard domain addressing */
snprintf (buffer, sizeof(buffer), "Return-Path: %.*s\n",
- cp - fp, fp);
+ (int)(cp - fp), fp);
}
/* Add Return-Path header to message */