提交 6119060d 编写于 作者: T Tom Lane

Fix possibly-uninitialized-variable warning from commit 9556aa01.

Heikki's compiler doesn't complain about end_ptr, apparently,
but mine does.

In passing, I failed to resist the temptation to remove the
no-longer-used fldnum variable, and relocate chunk_len's
declaration to a narrower scope.
上级 9556aa01
......@@ -4613,8 +4613,6 @@ text_to_array_internal(PG_FUNCTION_ARGS)
* to search for occurrences of fldsep.
*/
TextPositionState state;
int fldnum;
int chunk_len;
inputstring_len = VARSIZE_ANY_EXHDR(inputstring);
fldsep_len = VARSIZE_ANY_EXHDR(fldsep);
......@@ -4651,10 +4649,11 @@ text_to_array_internal(PG_FUNCTION_ARGS)
start_ptr = VARDATA_ANY(inputstring);
for (fldnum = 1;; fldnum++) /* field number is 1 based */
for (;;)
{
bool found;
char *end_ptr;
int chunk_len;
CHECK_FOR_INTERRUPTS();
......@@ -4663,6 +4662,7 @@ text_to_array_internal(PG_FUNCTION_ARGS)
{
/* fetch last field */
chunk_len = ((char *) inputstring + VARSIZE_ANY(inputstring)) - start_ptr;
end_ptr = NULL; /* not used, but some compilers complain */
}
else
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册