Skip to content

Commit 6119060

Browse files
committed
Fix possibly-uninitialized-variable warning from commit 9556aa0.
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.
1 parent 9556aa0 commit 6119060

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/adt/varlena.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4613,8 +4613,6 @@ text_to_array_internal(PG_FUNCTION_ARGS)
46134613
* to search for occurrences of fldsep.
46144614
*/
46154615
TextPositionState state;
4616-
int fldnum;
4617-
int chunk_len;
46184616

46194617
inputstring_len = VARSIZE_ANY_EXHDR(inputstring);
46204618
fldsep_len = VARSIZE_ANY_EXHDR(fldsep);
@@ -4651,10 +4649,11 @@ text_to_array_internal(PG_FUNCTION_ARGS)
46514649

46524650
start_ptr = VARDATA_ANY(inputstring);
46534651

4654-
for (fldnum = 1;; fldnum++) /* field number is 1 based */
4652+
for (;;)
46554653
{
46564654
bool found;
46574655
char *end_ptr;
4656+
int chunk_len;
46584657

46594658
CHECK_FOR_INTERRUPTS();
46604659

@@ -4663,6 +4662,7 @@ text_to_array_internal(PG_FUNCTION_ARGS)
46634662
{
46644663
/* fetch last field */
46654664
chunk_len = ((char *) inputstring + VARSIZE_ANY(inputstring)) - start_ptr;
4665+
end_ptr = NULL; /* not used, but some compilers complain */
46664666
}
46674667
else
46684668
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy