Re: Retain orig. filename as suffix for tmp. filename

On Mon, Feb 24, 2003 at 11:27:53AM +0100, Adam Byrtek / alpha wrote:
> On Mon, Feb 24, 2003 at 02:26:13AM +0100, Oswald Buddenhagen wrote:
> > > +    if (basename && *basename==PATH_SEP)
> > > +	basename++;
> > this is totally bogus.
> No, this is not 'totally bogus'. Filename var always contains at least
> one PATH_SEP:

> So this 'if' is just to protect from the impossible. As all
> programmers know impossible happens about once a year to (and I want
> to be protected just in case some code changes etc.), and we surely
> dont want to increment NULL of increment beyond the string. Result is
> not so important in impossible case :)
then add an assert(basename); and increment right away. it's nonsense to
handle "the impossible" in any other way than bailing out.


Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
Chaos, panic, and disorder - my work here is done.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]