mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
exec_on_slave_terminal(): reduce indentation level and use fmem_alloc()
instead of mem_alloc().
This commit is contained in:
parent
a2b9d8bb78
commit
b09d2c7a3f
@ -256,16 +256,16 @@ exec_on_slave_terminal( struct terminal *term,
|
||||
int fg)
|
||||
{
|
||||
int data_size = plen + dlen + 1 /* 0 */ + 1 /* fg */ + 2 /* 2 null char */;
|
||||
unsigned char *data = mem_alloc(data_size);
|
||||
unsigned char *data = fmem_alloc(data_size);
|
||||
|
||||
if (data) {
|
||||
data[0] = 0;
|
||||
data[1] = fg;
|
||||
memcpy(data + 2, path, plen + 1);
|
||||
memcpy(data + 2 + plen + 1, delete, dlen + 1);
|
||||
hard_write(term->fdout, data, data_size);
|
||||
mem_free(data);
|
||||
}
|
||||
if (!data) return;
|
||||
|
||||
data[0] = 0;
|
||||
data[1] = fg;
|
||||
memcpy(data + 2, path, plen + 1);
|
||||
memcpy(data + 2 + plen + 1, delete, dlen + 1);
|
||||
hard_write(term->fdout, data, data_size);
|
||||
fmem_free(data);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user