mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
regedit: Initialize hexedit buf with data if available.
Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
7c60ec12de
commit
ec6fb5d1ce
@ -23,7 +23,7 @@ static int hexedit_free(struct hexedit *buf)
|
||||
}
|
||||
|
||||
struct hexedit *hexedit_new(TALLOC_CTX *ctx, WINDOW *parent, int nlines,
|
||||
int y, int x, size_t sz)
|
||||
int y, int x, const void *data, size_t sz)
|
||||
{
|
||||
struct hexedit *buf;
|
||||
|
||||
@ -39,6 +39,10 @@ struct hexedit *hexedit_new(TALLOC_CTX *ctx, WINDOW *parent, int nlines,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (data) {
|
||||
memcpy(buf->data, data, sz);
|
||||
}
|
||||
|
||||
buf->len = sz;
|
||||
buf->alloc_size = sz;
|
||||
buf->win = derwin(parent, nlines, LINE_WIDTH, y, x);
|
||||
|
@ -41,7 +41,7 @@ struct hexedit {
|
||||
};
|
||||
|
||||
struct hexedit *hexedit_new(TALLOC_CTX *ctx, WINDOW *parent, int nlines,
|
||||
int y, int x, size_t sz);
|
||||
int y, int x, const void *data, size_t sz);
|
||||
void hexedit_set_cursor(struct hexedit *buf);
|
||||
void hexedit_refresh(struct hexedit *buf);
|
||||
void hexedit_driver(struct hexedit *buf, int c);
|
||||
|
Loading…
Reference in New Issue
Block a user