Re: Fine, let's see you using pathconf(3) on Windows (was: Re: Then there's PATH_MAX)

Liste des GroupesRevenir à col advocacy 
Sujet : Re: Fine, let's see you using pathconf(3) on Windows (was: Re: Then there's PATH_MAX)
De : fsquared (at) *nospam* fsquared.linux (Farley Flud)
Groupes : comp.os.linux.advocacy
Date : 10. Dec 2024, 15:44:12
Autres entêtes
Organisation : UsenetExpress - www.usenetexpress.com
Message-ID : <180fd7fa66284739$61502$1728$802601b3@news.usenetexpress.com>
References : 1 2 3
User-Agent : Pan/0.146 (Hic habitat felicitas; d7a48b4 gitlab.gnome.org/GNOME/pan.git)
On Tue, 10 Dec 2024 13:58:17 +0000, vallor wrote:

 
 - - cut here %<- - -
>

Should be "flush here."


 
if(argv[1])
    {
    path = argv[1];
    }
    }
 

WTF!

You check for arguments like this:

if(argc != 2)

or:

if(argv[1] == NULL)


>
    else {
    path = "/";
>

WTF!

You are assigning a pointer with the value 0x2F.

If it's then passed to pathconf() then KABOOM!


>
printf("%d\n",result);
 

"result" is an int.  pathcomp() returns a long int.

You should either have declared "result" as a long int
or:

result = (int)pathconf(path,_PC_PATH_MAX)



Congrats.  In a few short lines you have created a huge mess.



--
Hail Linux!  Hail FOSS!  Hail Stallman!

Date Sujet#  Auteur
9 Dec 24 * Then there's PATH_MAX13vallor
9 Dec 24 +- Re: Then there's PATH_MAX1Chris Ahlstrom
10 Dec 24 +* Re: Then there's PATH_MAX5DFS
10 Dec 24 i`* Re: Then there's PATH_MAX4Lawrence D'Oliveiro
10 Dec 24 i +- Re: Then there's PATH_MAX1vallor
10 Dec 24 i +- Re: Then there's PATH_MAX1Chris Ahlstrom
11 Dec 24 i `- Re: Then there's PATH_MAX1DFS
10 Dec 24 `* Re: Then there's PATH_MAX6Farley Flud
10 Dec 24  +- Re: Then there's PATH_MAX1Chris Ahlstrom
10 Dec 24  `* Fine, let's see you using pathconf(3) on Windows (was: Re: Then there's PATH_MAX)4vallor
10 Dec 24   `* Re: Fine, let's see you using pathconf(3) on Windows (was: Re: Then there's PATH_MAX)3Farley Flud
10 Dec 24    `* Re: Fine, let's see you using pathconf(3) on Windows (was: Re: Then there's PATH_MAX)2vallor
11 Dec 24     `- Re: Fine, let's see you using pathconf(3) on Windows (was: Re: Then there's PATH_MAX)1vallor

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal