Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
f2972575
Commit
f2972575
authored
Mar 12, 2020
by
npzacs
Committed by
hpi1
Jul 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor optimization to hex string printing
Ensure nul termination.
parent
5ceca4fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/util/strutl.c
src/util/strutl.c
+4
-1
No files found.
src/util/strutl.c
View file @
f2972575
...
...
@@ -249,10 +249,13 @@ char *str_get_hex_string(const char *p, int n)
char
*
str_print_hex
(
char
*
out
,
const
uint8_t
*
buf
,
int
count
)
{
static
const
char
nibble
[
16
]
=
"0123456789abcdef"
;
int
zz
;
for
(
zz
=
0
;
zz
<
count
;
zz
++
)
{
sprintf
(
out
+
(
zz
*
2
),
"%02x"
,
buf
[
zz
]);
out
[
zz
*
2
]
=
nibble
[
buf
[
zz
]
>>
4
];
out
[
zz
*
2
+
1
]
=
nibble
[
buf
[
zz
]
&
0x0f
];
}
out
[
zz
*
2
]
=
0
;
return
out
;
}
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