diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-07-06 15:03:52 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-07-06 15:03:52 +0200 |
commit | 34eefe41bf497e6f8e4c0f2f92f5b98d219269fe (patch) | |
tree | cc872216844305f223af022af4a6ae4978f22054 | |
parent | b1410abb112e6bd3e06c819f1f73883521b6ade4 (diff) | |
download | perl-smoke-me/Shut-It!.tar.gz |
In Base64.xs, refactor to avoid applying a unary minus to an unsigned type.smoke-me/Shut-It!
eol_len is of type STRLEN, and compilers can warn about attempting to negate
it. The intended buffer offset can be calculated with a (binary) subtraction
instead.
-rw-r--r-- | cpan/MIME-Base64/Base64.xs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cpan/MIME-Base64/Base64.xs b/cpan/MIME-Base64/Base64.xs index b6959bc0f0..2ce26ea97a 100644 --- a/cpan/MIME-Base64/Base64.xs +++ b/cpan/MIME-Base64/Base64.xs @@ -391,9 +391,9 @@ encode_qp(sv,...) break; } else if (*p == '\n' && eol_len && !binary) { - if (linelen == 1 && SvCUR(RETVAL) > eol_len + 1 && SvEND(RETVAL)[-eol_len - 2] == '=') { + if (linelen == 1 && SvCUR(RETVAL) > eol_len + 1 && SvPVX(RETVAL)[SvCUR(RETVAL) - eol_len - 2] == '=') { /* fixup useless soft linebreak */ - SvEND(RETVAL)[-eol_len - 2] = SvEND(RETVAL)[-1]; + SvPVX(RETVAL)[SvCUR(RETVAL) - eol_len - 2] = SvEND(RETVAL)[-1]; SvCUR_set(RETVAL, SvCUR(RETVAL) - 1); } else { |