Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain
Commits
d89a4363
Commit
d89a4363
authored
5 years ago
by
alexander.lysikov
Browse files
Options
Downloads
Patches
Plain Diff
fixed dap_chain_str_to_hash_fast()
parent
058cfbd3
No related branches found
No related tags found
1 merge request
!2
Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap_chain_common.c
+4
-4
4 additions, 4 deletions
dap_chain_common.c
with
4 additions
and
4 deletions
dap_chain_common.c
+
4
−
4
View file @
d89a4363
...
@@ -87,10 +87,10 @@ int dap_chain_str_to_hash_fast( const char * a_hash_str, dap_chain_hash_fast_t *
...
@@ -87,10 +87,10 @@ int dap_chain_str_to_hash_fast( const char * a_hash_str, dap_chain_hash_fast_t *
{
{
const
size_t
c_hash_str_size
=
sizeof
(
*
a_hash
)
*
2
+
1
/*trailing zero*/
+
2
/* heading 0x */
;
const
size_t
c_hash_str_size
=
sizeof
(
*
a_hash
)
*
2
+
1
/*trailing zero*/
+
2
/* heading 0x */
;
size_t
l_hash_str_len
=
strlen
(
a_hash_str
);
size_t
l_hash_str_len
=
strlen
(
a_hash_str
);
if
(
l_hash_str_len
==
c_hash_str_size
){
if
(
l_hash_str_len
+
1
==
c_hash_str_size
){
for
(
size_t
l_offset
=
2
;
l_offset
<
c
_hash_str_
size
;
l_offset
+=
2
){
for
(
size_t
l_offset
=
2
;
l_offset
<
l
_hash_str_
len
;
l_offset
+=
2
){
if
(
(
sscanf
(
a_hash_str
+
l_offset
,
"%02hhx"
,
a_hash
->
raw
+
l_offset
-
2
)
!=
1
)
||
if
(
(
sscanf
(
a_hash_str
+
l_offset
,
"%02hhx"
,
a_hash
->
raw
+
l_offset
/
2
-
1
)
!=
1
)
||
(
sscanf
(
a_hash_str
+
l_offset
,
"%02hhX"
,
a_hash
->
raw
+
l_offset
-
2
)
!=
1
)
(
sscanf
(
a_hash_str
+
l_offset
,
"%02hhX"
,
a_hash
->
raw
+
l_offset
/
2
-
1
)
!=
1
)
)
)
return
-
10
*
((
int
)
l_offset
);
// Wrong char
return
-
10
*
((
int
)
l_offset
);
// Wrong char
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment