Changeset 1707
- Timestamp:
- Jan 25, 2007, 12:59:33 PM (16 years ago)
- Location:
- zzuf/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/opts.h
r1705 r1707 19 19 struct opts 20 20 { 21 char const **newargv; 21 char **oldargv; 22 char **newargv; 22 23 char *bytes, *protect, *refuse; 23 24 uint32_t seed; -
zzuf/trunk/src/zzuf.c
r1706 r1707 67 67 68 68 static void loop_stdin(struct opts *); 69 static int run_process(char const * []);69 static int run_process(char const *, char *[]); 70 70 71 71 static void spawn_children(struct opts *); … … 353 353 354 354 /* Create new argv */ 355 opts->oldargv = argv; 355 356 opts->newargv = malloc((argc - optind + 1) * sizeof(char *)); 356 357 memcpy(opts->newargv, argv + optind, (argc - optind) * sizeof(char *)); … … 576 577 577 578 #if defined HAVE_FORK 578 if(run_process(opts-> newargv) < 0)579 if(run_process(opts->oldargv[0], opts->newargv) < 0) 579 580 exit(EXIT_FAILURE); 580 581 exit(EXIT_SUCCESS); 581 582 #else 582 if(run_process(opts-> newargv) < 0)583 if(run_process(opts->oldargv[0], opts->newargv) < 0) 583 584 return; 584 585 #endif … … 838 839 #endif 839 840 840 static int run_process(char const * argv[])841 static int run_process(char const *zzuf_exe, char *argv[]) 841 842 { 842 843 #if defined HAVE_FORK 843 844 char *libpath, *tmp; 844 int ret, len = strlen( argv[0]);845 int ret, len = strlen(zzuf_exe); 845 846 # if defined __APPLE__ 846 847 # define FILENAME "libzzuf.dylib" … … 859 860 860 861 libpath = malloc(len + strlen("/.libs/" FILENAME EXTRAINFO) + 1); 861 strcpy(libpath, argv[0]);862 strcpy(libpath, zzuf_exe); 862 863 863 864 tmp = strrchr(libpath, '/');
Note: See TracChangeset
for help on using the changeset viewer.