[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120510114520.GA10111@mwanda>
Date: Thu, 10 May 2012 14:45:20 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Kay Sievers <kay@...y.org>
Cc: Greg Kroah-Hartmann <greg@...ah.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH RESEND 2/3] kmsg: export printk records to the /dev/kmsg
interface
On Thu, May 03, 2012 at 02:29:41AM +0200, Kay Sievers wrote:
> + /* escape non-printable characters */
> + for (i = 0; i < msg->text_len; i++) {
> + char c = log_text(msg)[i];
> +
> + if (c < ' ' || c >= 128)
Signed char type is never larger than 127.
> + len += sprintf(user->buf + len, "\\x%02x", c);
> + else
> + user->buf[len++] = c;
> + }
> + user->buf[len++] = '\n';
> +
> + if (msg->dict_len) {
> + bool line = true;
> +
> + for (i = 0; i < msg->dict_len; i++) {
> + char c = log_dict(msg)[i];
> +
> + if (line) {
> + user->buf[len++] = ' ';
> + line = false;
> + }
> +
> + if (c == '\0') {
> + user->buf[len++] = '\n';
> + line = true;
> + continue;
> + }
> +
> + if (c < ' ' || c >= 128) {
Same.
> + len += sprintf(user->buf + len, "\\x%02x", c);
> + continue;
> + }
> +
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists