Date: Sun, 15 Oct 2006 18:20:23 GMT From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: freebsd-geom@FreeBSD.org Subject: Re: kern/104389: sys/geom/geom_dump.c doesn't encode XML entities Message-ID: <200610151820.k9FIKNAW034757@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/104389; it has been noted by GNATS. From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: douglas steinwand <dzs-pr@dzs.fx.org> 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 <name>%s</name>\n", pp->name); Should be: encode_entities(sb, "\t <name>%s</name>\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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610151820.k9FIKNAW034757>