mirror of
https://github.com/postgres/postgres.git
synced 2025-08-06 18:42:54 +03:00
Fix possibly-uninitialized-variable warning from commit 9556aa01c
.
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.
This commit is contained in:
@@ -4613,8 +4613,6 @@ text_to_array_internal(PG_FUNCTION_ARGS)
|
|||||||
* to search for occurrences of fldsep.
|
* to search for occurrences of fldsep.
|
||||||
*/
|
*/
|
||||||
TextPositionState state;
|
TextPositionState state;
|
||||||
int fldnum;
|
|
||||||
int chunk_len;
|
|
||||||
|
|
||||||
inputstring_len = VARSIZE_ANY_EXHDR(inputstring);
|
inputstring_len = VARSIZE_ANY_EXHDR(inputstring);
|
||||||
fldsep_len = VARSIZE_ANY_EXHDR(fldsep);
|
fldsep_len = VARSIZE_ANY_EXHDR(fldsep);
|
||||||
@@ -4651,10 +4649,11 @@ text_to_array_internal(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
start_ptr = VARDATA_ANY(inputstring);
|
start_ptr = VARDATA_ANY(inputstring);
|
||||||
|
|
||||||
for (fldnum = 1;; fldnum++) /* field number is 1 based */
|
for (;;)
|
||||||
{
|
{
|
||||||
bool found;
|
bool found;
|
||||||
char *end_ptr;
|
char *end_ptr;
|
||||||
|
int chunk_len;
|
||||||
|
|
||||||
CHECK_FOR_INTERRUPTS();
|
CHECK_FOR_INTERRUPTS();
|
||||||
|
|
||||||
@@ -4663,6 +4662,7 @@ text_to_array_internal(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
/* fetch last field */
|
/* fetch last field */
|
||||||
chunk_len = ((char *) inputstring + VARSIZE_ANY(inputstring)) - start_ptr;
|
chunk_len = ((char *) inputstring + VARSIZE_ANY(inputstring)) - start_ptr;
|
||||||
|
end_ptr = NULL; /* not used, but some compilers complain */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user