nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] merged patch


From: Steven Kneizys
Subject: Re: [Nano-devel] merged patch
Date: Thu, 21 Feb 2002 22:40:51 -0800 (PST)

--- Chris Allegretta <address@hidden> wrote:
> Trying again to go 
> through these memory cleanup patches is a bit of a bitch, too may 
> different emails :)
> 
> Chris A
> -- 
> Chris Allegretta      http://www.asty.org


Sorry!  Hopefully my last patch with everything will be a good thing,
if not let me know how to make things easier.

In the spirit of too many emails ... here is the routine I actually
used with no extra allocation on the osf beast:

void get_next_filename(char *name, char *ret)
{
    int i = 0;
    struct stat fs;

    strcpy(ret, name);

    while(1) {

       if (stat(ret, &fs) == -1)
           break;
       if (i == INT_MAX) {
           strcpy(ret, "");
           break;
       }

       i++;
       sprintf(ret, "%s.%d", name, i);
    }
}

take care,

Steve...

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]