summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
283cbeb)
mhfixmsg.c and mkstemp.c.
while (begin >= (off_t) ct->c_begin) {
fseeko (ct->c_fp, begin, SEEK_SET);
while ((bytes_read = fread (buffer, 1, sizeof buffer, ct->c_fp)) > 0) {
while (begin >= (off_t) ct->c_begin) {
fseeko (ct->c_fp, begin, SEEK_SET);
while ((bytes_read = fread (buffer, 1, sizeof buffer, ct->c_fp)) > 0) {
- char *end = buffer + bytes_read - 1;
- char *cp;
+ char *cp = rfind_str (buffer, bytes_read, "--");
+
+ if (cp) {
+ char *end;
- if ((cp = rfind_str (buffer, bytes_read, "--"))) {
/* Trim off trailing "--" and anything beyond. */
*cp-- = '\0';
if ((end = rfind_str (buffer, cp - buffer, "\n"))) {
/* Trim off trailing "--" and anything beyond. */
*cp-- = '\0';
if ((end = rfind_str (buffer, cp - buffer, "\n"))) {
boundary_in_content (&new_part->c_cefile.ce_fp,
new_part->c_cefile.ce_file,
boundary)) == -1) {
boundary_in_content (&new_part->c_cefile.ce_fp,
new_part->c_cefile.ce_file,
boundary)) == -1) {
if ((found_boundary = boundary_in_content (&new_part->c_fp,
new_part->c_file,
boundary)) == -1) {
if ((found_boundary = boundary_in_content (&new_part->c_fp,
new_part->c_file,
boundary)) == -1) {
if (found_boundary) {
advise (NULL, "giving up trying to find a unique boundary");
if (found_boundary) {
advise (NULL, "giving up trying to find a unique boundary");
tp += sizeof pattern - 1;
(void) strncpy(tp, suffix, suffix_len);
tp += sizeof pattern - 1;
(void) strncpy(tp, suffix, suffix_len);
+ /* tp += suffix_len; */