]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/getpart: use MIME::Base64 instead of home-cooked
authorDaniel Stenberg <daniel@haxx.se>
Fri, 28 Aug 2020 20:31:57 +0000 (22:31 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 29 Aug 2020 13:10:45 +0000 (15:10 +0200)
Since we already use the base64 package since a while back, we can just
as well switch to that here too.

It also happens to use the exact same function name, which otherwise
causes a run-time warning.

Reported-by: Marc Hörsken
Fixes #5885
Closes #5887

tests/getpart.pm

index 9519888eec455eb1e7baed17d6fe644d79f71b21..2162129dc6e3ca17e8e80c85a0f86e732fde69cd 100644 (file)
@@ -28,12 +28,7 @@ my $xmlfile;
 my $warning=0;
 my $trace=0;
 
-sub decode_base64 {
-  tr:A-Za-z0-9+/::cd;                   # remove non-base64 chars
-  tr:A-Za-z0-9+/: -_:;                  # convert to uuencoded format
-  my $len = pack("c", 32 + 0.75*length);   # compute length byte
-  return unpack("u", $len . $_);         # uudecode and print
-}
+use MIME::Base64;
 
 sub decode_hex {
     my $s = $_;