I am using the execl() function with this call:
execl("/localhome/globususer/mandel", "-b", xmin, xmax, ymin, ymax, "-f", name, (char*)NULL);
All xmin, xmax, ymin, ymax are initialized:
sprintf(xmin, "%f", (double)(XPOS - realmargin)); sprintf(xmax, "%f", (double)(XPOS + realmargin)); sprintf(ymin, "%f", (double)(YPOS - realmargin)); sprintf(ymax, "%f", (double)(YPOS + realmargin));
In the target program (/ localhome / globususer / mandel) xmin and ymin are defined as options, since they are negative numbers. Thus, getopt() detects "-0" by their values ββand causes an error.
However, a direct call from the command line, for example:
./mandel -b -0.452902 0.456189 0.367922 1.277013 -f /localhome/globususer/mandel.ppm
correctly understood by the program.
Does anyone have any ideas?