public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-perl/Exception-Base/files: Exception-Base-0.250.0-sprintf.patch
@ 2015-07-17 18:57 Andreas Huettel (dilfridge)
  0 siblings, 0 replies; only message in thread
From: Andreas Huettel (dilfridge) @ 2015-07-17 18:57 UTC (permalink / raw
  To: gentoo-commits

dilfridge    15/07/17 18:57:41

  Added:                Exception-Base-0.250.0-sprintf.patch
  Log:
  Version bump, bug 555206
  
  (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 84AD142F)

Revision  Changes    Path
1.1                  dev-perl/Exception-Base/files/Exception-Base-0.250.0-sprintf.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/Exception-Base/files/Exception-Base-0.250.0-sprintf.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/Exception-Base/files/Exception-Base-0.250.0-sprintf.patch?rev=1.1&content-type=text/plain

Index: Exception-Base-0.250.0-sprintf.patch
===================================================================
From 1cb0ea6afd4bb76e5a1d759efe27ea0f18306a82 Mon Sep 17 00:00:00 2001
From: Lee Johnson <lee@givengain.ch>
Date: Thu, 1 Jan 2015 22:33:54 +0000
Subject: [PATCH] resolve #1 - fix warnings new since perl 5.21.2

Redundant argument in %s - this is because the various calls to the
sprintf function offset the arrays by 1 (since the first element of
the array is the sprintf string) but use @_ (the number of elements
in the array) in the range: 1 .. @_

since it's offset by 1 we are going beyond the end of the array and
so sprintf consequently warns that we sent more arguments than it
expected. fix this by using @_ -1 in the range (number of elements
in the array minus 1)
---
 lib/Exception/Base.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/Exception/Base.pm b/lib/Exception/Base.pm
index 8dce19f..096e2a5 100644
--- a/lib/Exception/Base.pm
+++ b/lib/Exception/Base.pm
@@ -1362,7 +1362,7 @@ sub matches {   ## no critic qw(ProhibitExcessComplexity)
                     local $_ = ref $self->{$key} eq 'ARRAY'
                                ? sprintf(
                                      @{$self->{$key}}[0],
-                                     @{$self->{$key}}[1..@{$self->{$key}}]
+                                     @{$self->{$key}}[1..@{$self->{$key}}-1]
                                  )
                                : $self->{$key};
                     if (ref $arrval eq 'CODE') {
@@ -1393,7 +1393,7 @@ sub matches {   ## no critic qw(ProhibitExcessComplexity)
             local $_ = ref $self->{$key} eq 'ARRAY'
                        ? sprintf(
                              @{$self->{$key}}[0],
-                             @{$self->{$key}}[1..@{$self->{$key}}]
+                             @{$self->{$key}}[1..@{$self->{$key}}-1]
                          )
                        : $self->{$key};
 
@@ -1613,7 +1613,7 @@ sub _string_attributes {
     my ($self) = @_;
 
     return map { ref $_ eq 'ARRAY'
-                 ? sprintf(@$_[0], @$_[1..@$_])
+                 ? sprintf(@$_[0], @$_[1..@$_-1])
                  : $_ }
            grep { defined $_ and (ref $_ or $_ ne '') }
            map { $self->{$_} }
-- 
2.4.5






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-17 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17 18:57 [gentoo-commits] gentoo-x86 commit in dev-perl/Exception-Base/files: Exception-Base-0.250.0-sprintf.patch Andreas Huettel (dilfridge)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox