Search:

Type: Posts; User: dracayr

Search: Search took 0.01 seconds.

  1. Thread: argv change

    by dracayr
    Replies
    9
    Views
    2,177

    Thank you! the "\0" was the problem. strlen (dir)...

    Thank you! the "\0" was the problem. strlen (dir) is correct as a length of the string because in this case, dir is actually the directory name plus the file name. All that get_name_from_path does is...
  2. Thread: argv change

    by dracayr
    Replies
    9
    Views
    2,177

    making a local copy of **argv and using that copy...

    making a local copy of **argv and using that copy would be a workaround I guess, but I'm not sure how to copy **argv

    dracayr
  3. Thread: argv change

    by dracayr
    Replies
    9
    Views
    2,177

    Yes, that's exactly what I'm trying to say. ...

    Yes, that's exactly what I'm trying to say.

    Even if the argv arguments are mutable, how can they change from one point to another with only a parenthesis between them, as shown in the last 4 lines...
  4. Thread: argv change

    by dracayr
    Replies
    9
    Views
    2,177

    the third argument is a pointer to *argv[1]. And...

    the third argument is a pointer to *argv[1]. And I do use it in the two printf() functions near the bottom. Those two printf()s have different output (*argv[1] is changed), and I'm trying to find out...
  5. Thread: argv change

    by dracayr
    Replies
    9
    Views
    2,177

    This is how the function is called:...

    This is how the function is called:
    iterate_dir(argv[2], headers, argv[1]);

    headers is a local variable in main()
    I only added that last argument, *arg, to the function to debug after I noticed...
  6. Thread: argv change

    by dracayr
    Replies
    9
    Views
    2,177

    argv change

    hi,

    this function:


    void iterate_dir(char *dir, struct initrd_file_ptr *headers, char *arg)
    {
    DIR *directory;
    struct dirent *finfo;
Results 1 to 6 of 6