Skip to content

Commit

Permalink
Fix usage of sprintf() for Perl 5.22.
Browse files Browse the repository at this point in the history
Parameters not referenced in the format string are no longer allowed.
  • Loading branch information
disco-stu authored and dwsteele committed May 26, 2016
1 parent b1c779e commit 3d437d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
18 changes: 18 additions & 0 deletions doc/xml/release.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
<contributor-id type="github">gregscds</contributor-id>
</contributor>

<contributor id="vondendriesch.adrian">
<contributor-name-display>Adrian Vondendriesch</contributor-name-display>
<contributor-id type="github">disco-stu</contributor-id>
</contributor>

<contributor id="wieck.jan">
<contributor-name-display>Jan Wieck</contributor-name-display>
<contributor-id type="github">wieck</contributor-id>
Expand All @@ -80,6 +85,19 @@

<release-list>
<release date="XXXX-XX-XX" version="1.02dev" title="UNDER DEVELOPMENT">
<release-core-list>
<release-bug-list>
<release-item>
<release-item-contributor-list>
<release-item-contributor id="vondendriesch.adrian"/>
<release-item-reviewer id="steele.david"/>
</release-item-contributor-list>

<p>Fix usage of sprintf() due to new constraints in Perl 5.22. Parameters not referenced in the format string are no longer allowed.</p>
</release-item>
</release-bug-list>
</release-core-list>

<release-doc-list>
<release-bug-list>
<release-item>
Expand Down
9 changes: 8 additions & 1 deletion lib/pgBackRest/Common/String.pm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ sub timestampFormat

my ($iSecond, $iMinute, $iHour, $iMonthDay, $iMonth, $iYear, $iWeekDay, $iYearDay, $bIsDst) = localtime($lTime);

return sprintf($strFormat, $iYear + 1900, $iMonth + 1, $iMonthDay, $iHour, $iMinute, $iSecond);
if ($strFormat eq "%4d")
{
return sprintf($strFormat, $iYear + 1900)
}
else
{
return sprintf($strFormat, $iYear + 1900, $iMonth + 1, $iMonthDay, $iHour, $iMinute, $iSecond);
}
}

push @EXPORT, qw(timestampFormat);
Expand Down

0 comments on commit 3d437d9

Please sign in to comment.