We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb21617 commit 25cb8dfCopy full SHA for 25cb8df
ext/mbstring/mbstring.c
@@ -5564,16 +5564,14 @@ PHP_FUNCTION(mb_str_pad)
5564
size_t num_mb_pad_chars = pad_to_length - input_length;
5565
5566
/* We need to figure out the left/right padding lengths. */
5567
- size_t left_pad, right_pad;
+ size_t left_pad = 0, right_pad = 0; /* Initialize here to silence compiler warnings. */
5568
switch (pad_type_val) {
5569
case PHP_STR_PAD_RIGHT:
5570
- left_pad = 0;
5571
right_pad = num_mb_pad_chars;
5572
break;
5573
5574
case PHP_STR_PAD_LEFT:
5575
left_pad = num_mb_pad_chars;
5576
- right_pad = 0;
5577
5578
5579
case PHP_STR_PAD_BOTH:
0 commit comments