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

Re: svn commit: rev 653 - trunk/subversion/libsvn_fs trunk/subversion/tests/libsvn_fs

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2001-12-19 01:24:34 CET

Greg Stein <gstein@lyra.org> writes:

> > - *rev = atoi ((SVN_FS__NR_HDR_REV (SVN_FS__NR_HEADER (node_rev)))->data);
>
> As a curiosity, why was this failing? Shouldn't atoi() stop parsing at the
> first non-integer character? What was it doing such that it returned a funny
> value?

Nothing ensured it *was* non-integer. I posted this example yesterday:

> Breakpoint 3, svn_fs__dag_get_revision (rev=0xbffff5c0, node=0x807ba30,
> trail=0x8079618) at subversion/libsvn_fs/dag.c:291
> 291 SVN_ERR (get_node_revision (&node_rev, node, trail));
> (gdb) n
> 292 *rev = atoi ((SVN_FS__NR_HDR_REV (SVN_FS__NR_HEADER (node_rev)))->data);
>
> (gdb) p node_rev[0].children[0].children[0].next[0]
> $5 = {is_atom = 1, data = 0x807bb88 "216:03:2\001", len = 1, children = 0x0,
> next = 0x0}
>
> and the revison number comes out at 216. That might be memory
> corruption, but could it be that the correct revison is 2, and that
> there is a missing null terminator? The len field indcates 1 but
> atoi() won't use that.

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:53 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.