changed pio to used param->fixed_argv if the number of arguments is <= 3
This commit is contained in:
		| @ -2509,7 +2509,7 @@ QSE_EXPORT int qse_wcsspl ( | |||||||
|  *       QSE_MT('\\'), QSE_MT("n\nr\r") |  *       QSE_MT('\\'), QSE_MT("n\nr\r") | ||||||
|  *   ); |  *   ); | ||||||
|  * \endcode |  * \endcode | ||||||
|  * Given [xxx]:[\rabc\ndef]:[] as an input, the example breaks the second  |  * Given [xxx]:[\rabc\ndef]:[] as an input, the example translates the second  | ||||||
|  * fields to <CR>abc<NL>def where <CR> is a carriage return and <NL> is a  |  * fields to <CR>abc<NL>def where <CR> is a carriage return and <NL> is a  | ||||||
|  * new line. |  * new line. | ||||||
|  * |  * | ||||||
|  | |||||||
| @ -289,13 +289,19 @@ static int make_param ( | |||||||
| 		qse_mchar_t** argv; | 		qse_mchar_t** argv; | ||||||
| 		qse_mchar_t* mcmdptr; | 		qse_mchar_t* mcmdptr; | ||||||
|  |  | ||||||
| 		param->argv = QSE_MMGR_ALLOC ( | 		if (fcnt < QSE_COUNTOF(param->fixed_argv)) | ||||||
| 			pio->mmgr, (fcnt + 1) * QSE_SIZEOF(argv[0])); | 		{ | ||||||
|  | 			param->argv = param->fixed_argv; | ||||||
|  | 		} | ||||||
|  | 		else | ||||||
|  | 		{ | ||||||
|  | 			param->argv = QSE_MMGR_ALLOC (pio->mmgr, (fcnt + 1) * QSE_SIZEOF(argv[0])); | ||||||
| 			if (param->argv == QSE_NULL)  | 			if (param->argv == QSE_NULL)  | ||||||
| 			{ | 			{ | ||||||
| 				pio->errnum = QSE_PIO_ENOMEM; | 				pio->errnum = QSE_PIO_ENOMEM; | ||||||
| 				goto oops; | 				goto oops; | ||||||
| 			} | 			} | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		mcmdptr = mcmd; | 		mcmdptr = mcmd; | ||||||
| 		for (i = 0; i < fcnt; i++) | 		for (i = 0; i < fcnt; i++) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user