1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
* posix/regcomp.c (mark_opt_subexp_iter): Declare IDX as int.

	* posix/regexec.c (re_copy_regs): Fix testing for failed allocation.
	_IO_peekc_unlocked, _IO_putc_unlocked, _IO_getwc_unlocked, and
This commit is contained in:
Ulrich Drepper
2003-12-29 00:42:16 +00:00
parent 5a299c962e
commit a96c63edd2
3 changed files with 14 additions and 15 deletions

View File

@ -455,10 +455,10 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated)
if (regs_allocated == REGS_UNALLOCATED)
{ /* No. So allocate them with malloc. We allocate the arrays
for the start and end in one block. */
regs->start = re_malloc (regoff_t, 2 * need_regs);
if (BE (regs->start == NULL, 0))
regs->start = re_malloc (regoff_t, need_regs);
regs->end = re_malloc (regoff_t, need_regs);
if (BE (regs->start == NULL, 0) || BE (regs->end == NULL, 0))
return REGS_UNALLOCATED;
regs->end = regs->start + need_regs;
regs->num_regs = need_regs;
}
else if (regs_allocated == REGS_REALLOCATE)
@ -467,13 +467,10 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated)
leave it alone. */
if (BE (need_regs > regs->num_regs, 0))
{
regs->start = re_realloc (regs->start, regoff_t, 2 * need_regs);
if (BE (regs->start == NULL, 0))
{
regs->end = NULL;
return REGS_UNALLOCATED;
}
regs->end = regs->start + need_regs;
regs->start = re_realloc (regs->start, regoff_t, need_regs);
regs->end = re_realloc (regs->end, regoff_t, need_regs);
if (BE (regs->start == NULL, 0) || BE (regs->end == NULL, 0))
return REGS_UNALLOCATED;
regs->num_regs = need_regs;
}
}