AOSC-Archive / Anthon-Starter

Installation helper for AOSC OSes.
https://portal.anthonos.org/ast
GNU General Public License v2.0
5 stars 2 forks source link

Wrong Value Passing #5

Closed jyhi closed 10 years ago

jyhi commented 10 years ago

I think I made a mistake. In the program I wrote:

int chkargs ( int argc, char **argv, char *osimage, char *ostarget, img *imginfo, int instform, int verbose_mode, int quiet_mode, int will_pause, int will_reboot, int will_verify, int will_extract ); (funcs.h)

But in C variables are passed by value, that means all the 'int' variables will not work. :cry: I will try to fix it - change them into pointer type, like:

int chkargs ( int argc, char **argv, char *osimage, char *ostarget, img *imginfo, int *instform, int *verbose_mode, int *quiet_mode, int *will_pause, int *will_reboot, int *will_verify, int *will_extract );

And invoke the function by:

chkargs ( argc, argv, osimage, ostarget, imginfo, &instform, &verbose_mode, &quiet_mode, &will_pause, &will_reboot, &will_verify, &will_extract) (main.c)

For I haven't used these integer value in the program yet, I didn't find it.