Ticket #300: spawnvpe.diff
File spawnvpe.diff, 944 bytes (added by , 10 years ago) |
---|
-
spawnvpe.c
old new 16 16 char path[PATH_MAX]; 17 17 int rc; 18 18 19 if ( strlen(name) >= sizeof(exe) - 4)19 if (_path(path, name)) 20 20 { 21 errno = ENAMETOOLONG; 22 LIBCLOG_ERROR_RETURN(-1, "ret -1 - name is too long, %d bytes: %s\n", strlen(name), name); 21 if (strlen(name) >= sizeof(exe) - 4) 22 { 23 errno = ENAMETOOLONG; 24 LIBCLOG_ERROR_RETURN(-1, "ret -1 - name is too long, %d bytes: %s\n", strlen(name), name); 25 } 26 strcpy(exe, name); 27 _defext(exe, "exe"); 28 if (_path(path, exe)) 29 LIBCLOG_ERROR_RETURN_INT(-1); 23 30 } 24 strcpy(exe, name);25 _defext(exe, "exe");26 if (_path(path, exe))27 LIBCLOG_ERROR_RETURN_INT(-1);28 31 rc = spawnve(mode, path, argv, envp); 29 32 LIBCLOG_RETURN_INT(rc); 30 33 }