[LEDE-DEV] [PATCH 1/3] [ubox] remove unnecessary size struct between messages

Conor O'Gorman i at conorogorman.net
Fri Jun 3 04:27:18 PDT 2016


On 03/06/16 11:59, Dan Bugnar wrote:
> From: Dan Bugnar <dnbugnar at ocedo.com>
>
> The next message needs to be written after the data of current message.
> This was adding "sizeof(struct log_head)" bytes between messages.
>
> Signed-off-by: Dan Bugnar <danutbug at gmail.com>
> ---
>   log/syslog.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/log/syslog.c b/log/syslog.c
> index e8b6774..2042e93 100644
> --- a/log/syslog.c
> +++ b/log/syslog.c
> @@ -51,7 +51,7 @@ static regex_t pat_tstamp;
>   static struct log_head*
>   log_next(struct log_head *h, int size)
>   {
> -	struct log_head *n = (struct log_head *) &h->data[PAD(sizeof(struct log_head) + size)];
> +	struct log_head *n = (struct log_head *) &h->data[size];
>
You lost the PAD? Which is over the struct and size, not just the struct.

Conor



More information about the Lede-dev mailing list