summaryrefslogtreecommitdiff
path: root/source3/utils/regedit_hexedit.c
diff options
context:
space:
mode:
authorC. Davis <cd.rattan@gmail.com>2012-08-18 23:44:59 -0700
committerMichael Adam <obnox@samba.org>2013-04-29 13:06:36 +0200
commitd7d75fd311e6c8ebd799160411efe2a3ab3500c9 (patch)
tree79e8e9fa9e4d718aa0e1dccc2893d22e7d1112d7 /source3/utils/regedit_hexedit.c
parent384a593309d22c8d16315d362b8b6a8cfb425707 (diff)
downloadsamba-d7d75fd311e6c8ebd799160411efe2a3ab3500c9.tar.gz
samba-d7d75fd311e6c8ebd799160411efe2a3ab3500c9.tar.bz2
samba-d7d75fd311e6c8ebd799160411efe2a3ab3500c9.zip
regedit: Fix white space and wrap long lines.
Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/utils/regedit_hexedit.c')
-rw-r--r--source3/utils/regedit_hexedit.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/utils/regedit_hexedit.c b/source3/utils/regedit_hexedit.c
index 40a4e40782..e2864e3fae 100644
--- a/source3/utils/regedit_hexedit.c
+++ b/source3/utils/regedit_hexedit.c
@@ -70,7 +70,8 @@ struct hexedit *hexedit_new(TALLOC_CTX *ctx, WINDOW *parent, int nlines,
}
buf->cursor_x = HEX_COL1;
- buf->status_line = derwin(buf->win, 1, LINE_WIDTH, max_rows(buf->win), 0);
+ buf->status_line = derwin(buf->win, 1, LINE_WIDTH, max_rows(buf->win),
+ 0);
if (buf->status_line == NULL) {
goto fail;
}
@@ -113,7 +114,9 @@ void hexedit_refresh(struct hexedit *buf)
end = buf->len;
}
- for (off = buf->offset, lineno = 0; off < end; off += BYTES_PER_LINE, ++lineno) {
+ for (off = buf->offset, lineno = 0;
+ off < end;
+ off += BYTES_PER_LINE, ++lineno) {
uint8_t *line = buf->data + off;
size_t i, endline;
@@ -150,7 +153,8 @@ void hexedit_refresh(struct hexedit *buf)
static void calc_cursor_offset(struct hexedit *buf)
{
- buf->cursor_offset = buf->offset + buf->cursor_y * BYTES_PER_LINE + buf->cursor_line_offset;
+ buf->cursor_offset = buf->offset + buf->cursor_y * BYTES_PER_LINE +
+ buf->cursor_line_offset;
}
static int offset_to_hex_col(size_t pos)
@@ -341,7 +345,8 @@ static void do_edit(struct hexedit *buf, int c)
if (!isprint(c)) {
c = '.';
}
- mvwaddch(buf->win, buf->cursor_y, ASCII_COL + buf->cursor_line_offset, c);
+ mvwaddch(buf->win, buf->cursor_y,
+ ASCII_COL + buf->cursor_line_offset, c);
cursor_right(buf);
} else {
if (!isxdigit(c)) {
@@ -365,7 +370,8 @@ static void do_edit(struct hexedit *buf, int c)
if (!isprint(c)) {
c = '.';
}
- mvwaddch(buf->win, buf->cursor_y, ASCII_COL + buf->cursor_line_offset, c);
+ mvwaddch(buf->win, buf->cursor_y,
+ ASCII_COL + buf->cursor_line_offset, c);
if (buf->cursor_x + 1 != HEX_COL2_END) {
cursor_right(buf);