[augeas-devel] src/augtool.c (cleanpath): Don't access path[-1].

David Lutterkort dlutter at redhat.com
Tue May 20 19:51:16 UTC 2008


On Tue, 2008-05-20 at 21:22 +0200, Jim Meyering wrote:
> I spotted this by inspection.
> However, it may not be possible to trigger bad behavior, since
> chk_args seems to guard against any zero-length PATH arguments.

ACK, good catch anyway, and better to check for it.

> Note: this fix violates decl-after-code, so
> if you want to accommodate pre-c99 compilers
> I'll move the declaration of "e" up.

I am not too fussed about non-C99 compilers, and there's plenty of other
C99 constructs all over the code.

David





More information about the augeas-devel mailing list