From owner-freebsd-geom@FreeBSD.ORG Sun Oct 15 18:20:24 2006 Return-Path: X-Original-To: freebsd-geom@hub.freebsd.org Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CC8A16A412 for ; Sun, 15 Oct 2006 18:20:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8951343D45 for ; Sun, 15 Oct 2006 18:20:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9FIKNiI034758 for ; Sun, 15 Oct 2006 18:20:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9FIKNAW034757; Sun, 15 Oct 2006 18:20:23 GMT (envelope-from gnats) Date: Sun, 15 Oct 2006 18:20:23 GMT Message-Id: <200610151820.k9FIKNAW034757@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: "Poul-Henning Kamp" Cc: Subject: Re: kern/104389: sys/geom/geom_dump.c doesn't encode XML entities X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Poul-Henning Kamp List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2006 18:20:24 -0000 The following reply was made to PR kern/104389; it has been noted by GNATS. From: "Poul-Henning Kamp" To: douglas steinwand Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/104389: sys/geom/geom_dump.c doesn't encode XML entities Date: Sun, 15 Oct 2006 18:12:56 +0000 In message <200610132043.k9DKh3lW055022@www.freebsd.org>, douglas steinwand wri tes: >geom_dump.c should encode XML entities. Attached is a patch. I don't like it in two ways. I'm not keep on the encoding, and would be inclined to say "Don't use such names then", but I can probably be convinced that this is actually a good idea if sensible examples are shown. The other thing is that in the patch, the _encode_entities() function should not have a leading underscore and should take arguments: static void encode_entities(struct sbuf *sb, const char *fmt, const char *str, int len); So that usage would not need a randomsized local buffer and double enveloping of the call: >- sbuf_printf(sb, "\t %s\n", pp->name); Should be: encode_entities(sb, "\t %s\n", pp->name, -1); (-1 for len means "use strlen") -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.