Pointer Question

S

Songmuh

I'm trying to use the InfoZIP by calling its main fucntion. When it's first
called, everything works. The second call with the same command except for
the zip filename failed with the error: zip error: Nothing to do!.

I've looked at the source code and found the problematic line of code that
caused this issue. It happens when a local structure is assigned to a global
structure pointer.
(in the fileio.c file) as follows:

strcpy(f->name, name);
f->iname = iname;
f->zname = zname;
f->dosflag = dosflag;
*fnxt = f; // This is the problematic line


where *fnxt is defined as

struct flist far * far *fnxt = &found;

and f is a local structure defined as

struct flist far *f;

I did a printf before and after each line and found that the value of found
is turned into 0 when the code is called the second time.

Any help will be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top