user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] nntp: fix printf warnings
@ 2015-11-18 22:58  7% Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-11-18 22:58 UTC (permalink / raw)
  To: meta

Error messages and request lines may contain '%' which would
throw off Perl printf.
---
 lib/PublicInbox/NNTP.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 944e930..0bfafa8 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -114,7 +114,7 @@ sub process_line ($$) {
 	my $err = $@;
 	if ($err && !$self->{closed}) {
 		chomp($l = Dumper(\$l));
-		err($self, "error from: $l ($err)");
+		err($self, 'error from: %s (%s)', $l, $err);
 		$res = '503 program fault - command not performed';
 	}
 	return 0 unless defined $res;
@@ -568,8 +568,8 @@ sub long_response ($$$$) {
 
 			if ($err) {
 				err($self,
-				    "$err during long response[$fd] - %0.6f",
-					now() - $t0);
+				    "%s during long response[$fd] - %0.6f",
+				    $err, now() - $t0);
 			}
 			if ($self->{closed}) {
 				out($self, " deferred[$fd] aborted - %0.6f",
@@ -925,7 +925,7 @@ sub event_read {
 		$r = eval { $self->process_line($line) };
 		my $d = $self->{long_res} ?
 			" deferred[$fd]" : '';
-		out($self, "[$fd] $line - %0.6f$d", now() - $t0);
+		out($self, "[$fd] %s - %0.6f$d", $line, now() - $t0);
 	}
 
 	return $self->close if $r < 0;
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-11-18 22:58  7% [PATCH] nntp: fix printf warnings Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).