All of lore.kernel.org
 help / color / mirror / Atom feed
From: Derek Morton <derek.j.morton@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: thomas.wood@intel.com
Subject: [PATCH i-g-t] igt_core: Fix logging to display extended line
Date: Wed, 23 Dec 2015 15:34:48 +0000	[thread overview]
Message-ID: <1450884888-18931-1-git-send-email-derek.j.morton@intel.com> (raw)

line[strlen(line)] will always evaluate to NULL so line_continuation
was always true. That prevented the program name, pid and log level
ever being printed.
Changed to [strlen(line) - 1] so the last character before the null
terminator is compared with '\n' to determine line_continuation.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
---
 lib/igt_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 84cf8d2..221ed7e 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1748,7 +1748,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 		goto out;
 	}
 
-	line_continuation = line[strlen(line)] != '\n';
+	line_continuation = line[strlen(line) - 1] != '\n';
 
 	/* append log buffer */
 	_igt_log_buffer_append(formatted_line);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-12-23 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 15:34 Derek Morton [this message]
2016-01-05 15:07 ` [PATCH i-g-t] igt_core: Fix logging to display extended line Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450884888-18931-1-git-send-email-derek.j.morton@intel.com \
    --to=derek.j.morton@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas.wood@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.