[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r18486 - trunk/subversion/libsvn_ra_serf

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2006-02-17 09:00:31 CET

On Thu, 16 Feb 2006 jerenkrantz@tigris.org wrote:

> @@ -69,7 +82,7 @@
> * has a lifetime tied to POOL.
> */
> dav_props_t
> -expand_ns(ns_t *ns_list, const char *name, apr_pool_t *pool)
> +expand_ns(ns_t *ns_list, const char *name)
> {
> char *colon;
> dav_props_t prop_name;
> @@ -77,29 +90,30 @@
> colon = strchr(name, ':');

Hidden cast away of const. (See below)

> if (colon)
> {
> - char *stripped_name;
> ns_t *ns;
>
> - stripped_name = apr_pstrmemdup(pool, name, colon-name);
> + *colon = '\0';

Which we now modify. While you could probably argue that name must be
modifiable anyway, I still think this is ugly and error-prone. Couldn't
you use strncmp instead?

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 17 09:01:26 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.