Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3e9f3c32
Commit
3e9f3c32
authored
Oct 25, 2005
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted mysys/base64.c into C code (not C++).
parent
afb50a5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
mysys/base64.c
mysys/base64.c
+6
-3
No files found.
mysys/base64.c
View file @
3e9f3c32
...
...
@@ -56,13 +56,14 @@ base64_encode(const void *src, size_t src_len, char *dst)
for
(;
i
<
src_len
;
len
+=
4
)
{
unsigned
c
;
if
(
len
==
76
)
{
len
=
0
;
*
dst
++=
'\n'
;
}
unsigned
c
;
c
=
s
[
i
++
];
c
<<=
8
;
...
...
@@ -216,6 +217,8 @@ main(void)
char
*
src
=
(
char
*
)
malloc
(
src_len
);
char
*
s
=
src
;
char
*
str
;
char
*
dst
;
for
(
j
=
0
;
j
<
src_len
;
j
++
)
{
...
...
@@ -224,11 +227,11 @@ main(void)
}
/* Encode */
char
*
str
=
(
char
*
)
malloc
(
base64_needed_encoded_length
(
src_len
));
str
=
(
char
*
)
malloc
(
base64_needed_encoded_length
(
src_len
));
require
(
base64_encode
(
src
,
src_len
,
str
)
==
0
);
/* Decode */
char
*
dst
=
(
char
*
)
malloc
(
base64_needed_decoded_length
(
strlen
(
str
)));
dst
=
(
char
*
)
malloc
(
base64_needed_decoded_length
(
strlen
(
str
)));
dst_len
=
base64_decode
(
str
,
strlen
(
str
),
dst
);
require
(
dst_len
==
src_len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment