Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
49952996
Commit
49952996
authored
Mar 21, 2016
by
Bernhard Nortmann
Browse files
fel: Simplify hexdump() single character output, using putchar()
Signed-off-by:
Bernhard Nortmann
<
bernhard.nortmann@web.de
>
parent
425278ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
fel.c
View file @
49952996
...
...
@@ -317,23 +317,19 @@ void hexdump(void *data, uint32_t offset, size_t size)
size_t
i
;
printf
(
"%08lx: "
,(
long
int
)
offset
+
j
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
if
(
(
j
+
i
)
<
size
)
{
if
(
j
+
i
<
size
)
printf
(
"%02x "
,
buf
[
j
+
i
]);
}
else
{
else
printf
(
"__ "
);
}
}
p
rintf
(
" "
);
p
utchar
(
' '
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
if
(
j
+
i
>=
size
)
{
printf
(
"."
);
}
else
if
(
isprint
(
buf
[
j
+
i
]))
{
printf
(
"%c"
,
buf
[
j
+
i
]);
}
else
{
printf
(
"."
);
}
if
(
j
+
i
>=
size
)
putchar
(
'.'
);
else
putchar
(
isprint
(
buf
[
j
+
i
])
?
buf
[
j
+
i
]
:
'.'
);
}
p
rintf
(
"
\n
"
);
p
utchar
(
'
\n
'
);
}
}
...
...
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