radareorg / sdb

Simple and fast string based key-value database with support for arrays and json
https://www.radare.org/
MIT License
218 stars 62 forks source link

Fix b64_* for Solaris #164

Closed thestr4ng3r closed 5 years ago

thestr4ng3r commented 5 years ago

Solaris has its own b64_encode and b64_decode functions, which the ones here can conflict with:

Standard C Library Functions                                    b64_encode(3C)

NAME
       b64_encode,  b64_decode,  b32_encode,  b32_decode - encode and decode a
       string in base64 or base32

SYNOPSIS
       #include <string.h>

       ssize_t b64_encode(char restrict *outbuf, size_t outbufsz,
                const void restrict *inbuf, size_t inbufsz,
                const char *alphabet, uint64_t flags);

       ssize_t b64_decode(void *outbuf, size_t outbufsz,
                const char *inbuf, const char *alphabet, uint64_t flags);
radare commented 5 years ago

Lets just prefix it with r coz we own this letter

On 5 Oct 2018, at 19:13, Riccardo Schirone notifications@github.com wrote:

@ret2libc commented on this pull request.

In src/base64.c:

@@ -10,7 +10,7 @@ static const char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\]^_`abcdefghijklmnopq";

-static void b64_encode(const ut8 in[3], char out[4], int len) { +static void _b64encode(const ut8 in[3], char out[4], int len) { they told me it's better to avoid names that start with or __

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

thestr4ng3r commented 5 years ago

I used sdb_. Is that fine too?

radare commented 5 years ago

Yeah sgtm