1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-08 12:01:56 +00:00

net-p2p/bnbt: unbreak with libc++ 3.9

base64.cpp:129:13: error: assigning to 'char *' from incompatible type 'const char *'
    if  ((b = strchr(s, pPad[0])) != NULL)  // Only one, two or three equal...
            ^ ~~~~~~~~~~~~~~~~~~

Reported by:	pkg-fallout
This commit is contained in:
Jan Beich 2017-02-01 20:22:34 +00:00
parent 52f91af65c
commit 42040b1790
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=433100
2 changed files with 27 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= bnbt
PORTVERSION= 8.5
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= net-p2p
MASTER_SITES= http://opensource.depthstrike.com/${PORTNAME}/
DISTNAME= ${SNAPSHOT}-${PORTNAME}${PORTVERSION:C/\.//}-src

View File

@ -0,0 +1,26 @@
--- base64.cpp.orig 2017-02-01 19:29:59 UTC
+++ base64.cpp
@@ -114,6 +114,7 @@ uchar pBase64[] = {
char *b64decode(const char *s)
{
int l = strlen(s); // Get length of Base64 string.
+ const char *p; // Separator position
char *b; // Decoding buffer pointers.
uchar c = 0; // Character to decode.
int x = 0; // General purpose integers.
@@ -126,12 +127,12 @@ char *b64decode(const char *s)
if (l % 4) // If it's not modulo 4, then it...
return b64isnot(NULL); // ...can't be a Base64 string.
- if ((b = strchr(s, pPad[0])) != NULL) // Only one, two or three equal...
+ if ((p = strchr(s, pPad[0])) != NULL) // Only one, two or three equal...
{ // ...'=' signs are allowed at...
- if ((b - s) < (l - 3)) // ...the end of the Base64 string.
+ if ((p - s) < (l - 3)) // ...the end of the Base64 string.
return b64isnot(NULL); // Any other equal '=' signs are...
else // ...invalid.
- if (strncmp(b, (const char *) pPad + 3 - (s + l - b), s + l - b))
+ if (strncmp(p, (const char *) pPad + 3 - (s + l - p), s + l - p))
return b64isnot(NULL);
}