Commit 43c1b5d2 by Bruce Korb Committed by Bruce Korb

correct misuse of variables

From-SVN: r90789
parent 13cf6837
2004-11-15 Bruce Korb <bkorb@gnu.org>
* fixincl.c(fix_with_system): correct misuse of variables and
incorrect application of "sizeof()".
2004-11-13 Joseph S. Myers <joseph@codesourcery.com> 2004-11-13 Joseph S. Myers <joseph@codesourcery.com>
* inclhack.def (hpux_maxint, limits_ifndefs, math_huge_val_ifndef, * inclhack.def (hpux_maxint, limits_ifndefs, math_huge_val_ifndef,
......
...@@ -851,41 +851,43 @@ fix_with_system (tFixDesc* p_fixd, ...@@ -851,41 +851,43 @@ fix_with_system (tFixDesc* p_fixd,
char* pz_cmd; char* pz_cmd;
char* pz_scan; char* pz_scan;
size_t argsize; size_t argsize;
int i;
tSCC *z_applyfix_prog[2] = {
"/../fixincludes/applyfix" EXE_EXT,
"/../../fixincludes/applyfix" EXE_EXT };
if (p_fixd->fd_flags & FD_SUBROUTINE) if (p_fixd->fd_flags & FD_SUBROUTINE)
for (i = 0; i < 2; i++) {
{ static const char z_applyfix_prog[] =
struct stat buf; "/../fixincludes/applyfix" EXE_EXT;
argsize = 32 struct stat buf;
+ strlen( pz_orig_dir ) argsize = 32
+ sizeof( z_applyfix_prog ) + strlen (pz_orig_dir)
+ strlen( pz_fix_file ) + sizeof (z_applyfix_prog)
+ strlen( pz_file_source ) + strlen (pz_fix_file)
+ strlen( pz_temp_file ); + strlen (pz_file_source)
+ strlen (pz_temp_file);
pz_cmd = xmalloc (argsize);
/* Allocate something sure to be big enough for our purposes */
strcpy( pz_cmd, pz_orig_dir ); pz_cmd = xmalloc (argsize);
pz_scan = pz_cmd + strlen( pz_orig_dir ); strcpy (pz_cmd, pz_orig_dir);
strcpy( pz_scan, z_applyfix_prog ); pz_scan = pz_cmd + strlen (pz_orig_dir);
pz_scan += sizeof( z_applyfix_prog ) - 1;
strcpy (pz_scan, z_applyfix_prog);
if (stat (pz_scan, &buf) != -1)
{ /* IF we can't find the "applyfix" executable file at the first guess,
*(pz_scan++) = ' '; try one level higher up */
/* if (stat (pz_cmd, &buf) == -1)
* Now add the fix number and file names that may be needed {
*/ strcpy (pz_scan, "/..");
sprintf (pz_scan, "%ld \'%s\' \'%s\' \'%s\'", p_fixd - fixDescList, strcpy (pz_scan+3, z_applyfix_prog);
pz_fix_file, pz_file_source, pz_temp_file); }
break;
} pz_scan += strlen (pz_scan);
}
/*
* Now add the fix number and file names that may be needed
*/
sprintf (pz_scan, " %ld \'%s\' \'%s\' \'%s\'", p_fixd - fixDescList,
pz_fix_file, pz_file_source, pz_temp_file);
}
else /* NOT an "internal" fix: */ else /* NOT an "internal" fix: */
{ {
size_t parg_size; size_t parg_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment