Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265811AbUFSEYj (ORCPT ); Sat, 19 Jun 2004 00:24:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265812AbUFSEYj (ORCPT ); Sat, 19 Jun 2004 00:24:39 -0400 Received: from willy.net1.nerim.net ([62.212.114.60]:48650 "EHLO willy.net1.nerim.net") by vger.kernel.org with ESMTP id S265811AbUFSEYg (ORCPT ); Sat, 19 Jun 2004 00:24:36 -0400 Date: Sat, 19 Jun 2004 06:18:44 +0200 From: Willy Tarreau To: matthew-lkml@newtoncomputing.co.uk Cc: Jesper Juhl , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Stop printk printing non-printable chars Message-ID: <20040619041844.GG29808@alpha.home.local> References: <20040618205355.GA5286@newtoncomputing.co.uk> <20040618235223.GB5286@newtoncomputing.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040618235223.GB5286@newtoncomputing.co.uk> User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 984 Lines: 32 Hi, On Sat, Jun 19, 2004 at 12:52:23AM +0100, matthew-lkml@newtoncomputing.co.uk wrote: > /* > + * Emit character in numeric (octal) form > + */ Don't most of us handle hex easier than octal ? I'd prefer to read \xE9 than \351, but that's only personal taste. > - emit_log_char(*p); > + switch (*p) { > + case '\n': > + case '\t': > + emit_log_char(*p); > + break; Logically, ig you use '\' as an escape char, your should also protect it to avoid confusion, because if you read "\351", you won't know if the function really sent these four chars or only the \xE9 char. Another way to do it would be to display "" like less, but '<' and '>' are sensible because they're used to indicate the log level. Regards, Willy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/