diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-26 14:14:39 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-26 14:14:39 +1300 |
commit | 22d54ecf48ac7a42351d6edbb60dcbd151078772 (patch) | |
tree | af10b2ef06c577935f33dd66f5b6f85f7617c4c0 /funcptr.c | |
parent | Move fpv to be static file var (diff) | |
download | funcptr-22d54ecf48ac7a42351d6edbb60dcbd151078772.tar.gz funcptr-22d54ecf48ac7a42351d6edbb60dcbd151078772.zip |
Count through argv so we don't edit it in place
Diffstat (limited to 'funcptr.c')
-rw-r--r-- | funcptr.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -28,8 +28,9 @@ void fpv_exec(int (**fpv)(int), int n) { } int main(int argc, char **argv) { - for (argv++, argc--; argc; argv++, argc--) { - fpv_exec(fpv, atoi(*argv)); + int i; + for (i = 1; i < argc; i++) { + fpv_exec(fpv, atoi(argv[i])); } exit(EXIT_SUCCESS); |