Skip to content

Commit

Permalink
Repair missing 7bit name part in rfc2047 on arm and mips architecture.
Browse files Browse the repository at this point in the history
The problem was, that on arm* and mips* architectures the fetchaddr tests
failed, since from "Günther family1" the " family1" was stripped on these
architectures (amd64, i386, ppc64el and s390x were okay).
This was based on the fact, that strfcpy (and strncpy) on these
architectures didn't copy anything.
Using snprintf instead fixes the issue.
  • Loading branch information
RolandRosenfeld committed Sep 18, 2022
1 parent 1d91bf7 commit c605d5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [Unreleased]

### Fixed

- Repair missing 7bit name part in rfc2047 on arm and mips architecture.

## [0.51] - 2022-09-17

### Added
Expand Down
3 changes: 2 additions & 1 deletion rfc2047.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <ctype.h>
#include <string.h>
#include <stdio.h>
#ifdef HAVE_ICONV
#include <iconv.h>
#include <errno.h>
Expand Down Expand Up @@ -227,7 +228,7 @@ void rfc2047_decode (char *d, const char *s, size_t dlen)
{
/* no encoded words */
if (d != s)
strfcpy (d, s, dlen + 1);
snprintf(d, dlen, "%s", s);
return;
}

Expand Down

0 comments on commit c605d5d

Please sign in to comment.