changed pio to used param->fixed_argv if the number of arguments is <= 3

This commit is contained in:
2016-04-11 14:32:27 +00:00
parent 5b395db9e7
commit 9b4c897d6c
3 changed files with 14 additions and 8 deletions

View File

@ -289,12 +289,18 @@ static int make_param (
qse_mchar_t** argv;
qse_mchar_t* mcmdptr;
param->argv = QSE_MMGR_ALLOC (
pio->mmgr, (fcnt + 1) * QSE_SIZEOF(argv[0]));
if (param->argv == QSE_NULL)
if (fcnt < QSE_COUNTOF(param->fixed_argv))
{
pio->errnum = QSE_PIO_ENOMEM;
goto oops;
param->argv = param->fixed_argv;
}
else
{
param->argv = QSE_MMGR_ALLOC (pio->mmgr, (fcnt + 1) * QSE_SIZEOF(argv[0]));
if (param->argv == QSE_NULL)
{
pio->errnum = QSE_PIO_ENOMEM;
goto oops;
}
}
mcmdptr = mcmd;

View File

@ -297,7 +297,7 @@ int qse_mbsspltrn (
}
p++;
}
exit_point:
exit_point:
;
}
}
@ -583,7 +583,7 @@ int qse_wcsspltrn (
}
p++;
}
exit_point:
exit_point:
;
}
}