Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
c8dced17
Commit
c8dced17
authored
Jan 07, 1999
by
Niels Möller
Browse files
* sexp.c (encode_base64): Bug fix (don't use several ++ in an
expression without sequence points). Rev: src/sexp.c:1.9
parent
478124af
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sexp.c
View file @
c8dced17
...
...
@@ -522,11 +522,11 @@ struct lsh_string *encode_base64(struct lsh_string *s,
unsigned
i
;
/* Loop over all but the last group. */
for
(
i
=
0
;
i
<
full_groups
;
dst
+=
4
,
i
++
)
for
(
i
=
0
;
i
<
full_groups
;
dst
+=
4
,
src
+=
3
,
i
++
)
{
encode_base64_group
(
(
(
*
src
++
)
<<
16
)
|
(
(
*
src
++
)
<<
8
)
|
(
*
src
++
)
,
dst
);
encode_base64_group
(
(
src
[
0
]
<<
16
)
|
(
src
[
1
]
<<
8
)
|
src
[
2
]
,
dst
);
}
}
switch
(
last
)
...
...
@@ -535,14 +535,14 @@ struct lsh_string *encode_base64(struct lsh_string *s,
/* Finished */
break
;
case
1
:
encode_base64_group
(
(
*
src
++
)
<<
16
,
dst
);
encode_base64_group
(
src
[
0
]
<<
16
,
dst
);
dst
+=
2
;
*
dst
++
=
'='
;
*
dst
++
=
'='
;
break
;
case
2
:
encode_base64_group
(
(
(
*
src
++
)
<<
16
)
|
(
(
*
src
++
)
<<
8
),
dst
);
encode_base64_group
(
(
src
[
0
]
<<
16
)
|
(
src
[
1
]
<<
8
),
dst
);
dst
+=
3
;
*
dst
++
=
'='
;
break
;
...
...
Write
Preview
Supports
Markdown
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