git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] api-trace.txt: fix typo
@ 2016-04-05 10:05 Elia Pinto
  2016-04-05 17:15 ` Eric Sunshine
  0 siblings, 1 reply; 3+ messages in thread
From: Elia Pinto @ 2016-04-05 10:05 UTC (permalink / raw)
  To: git; +Cc: karsten.blees, Elia Pinto

The correct api is trace_printf_key

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 Documentation/technical/api-trace.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
index 389ae16..45a0ecd 100644
--- a/Documentation/technical/api-trace.txt
+++ b/Documentation/technical/api-trace.txt
@@ -28,7 +28,7 @@ static struct trace_key trace_foo = TRACE_KEY_INIT(FOO);
 
 static void trace_print_foo(const char *message)
 {
-	trace_print_key(&trace_foo, message);
+	trace_printf_key(&trace_foo, message);
 }
 ------------
 +
-- 
2.8.0.270.g9d4de1f.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] api-trace.txt: fix typo
  2016-04-05 10:05 [PATCH] api-trace.txt: fix typo Elia Pinto
@ 2016-04-05 17:15 ` Eric Sunshine
  2016-04-05 20:49   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sunshine @ 2016-04-05 17:15 UTC (permalink / raw)
  To: Elia Pinto; +Cc: Git List, Karsten Blees

On Tue, Apr 5, 2016 at 6:05 AM, Elia Pinto <gitter.spiros@gmail.com> wrote:
> The correct api is trace_printf_key
>
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> ---
> diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
> @@ -28,7 +28,7 @@ static struct trace_key trace_foo = TRACE_KEY_INIT(FOO);
>  static void trace_print_foo(const char *message)
>  {
> -       trace_print_key(&trace_foo, message);
> +       trace_printf_key(&trace_foo, message);
>  }

Since you're touching this already, I wonder if it would make sense to
rewrite this example to avoid the dangerous sending of an arbitrary
string (which might contain %) to a printf-like function. Like this,
for example:

    trace_printf_key(&trace_foo, "%s", message);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] api-trace.txt: fix typo
  2016-04-05 17:15 ` Eric Sunshine
@ 2016-04-05 20:49   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2016-04-05 20:49 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Elia Pinto, Git List, Karsten Blees

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Tue, Apr 5, 2016 at 6:05 AM, Elia Pinto <gitter.spiros@gmail.com> wrote:
>> The correct api is trace_printf_key
>>
>> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
>> ---
>> diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
>> @@ -28,7 +28,7 @@ static struct trace_key trace_foo = TRACE_KEY_INIT(FOO);
>>  static void trace_print_foo(const char *message)
>>  {
>> -       trace_print_key(&trace_foo, message);
>> +       trace_printf_key(&trace_foo, message);
>>  }
>
> Since you're touching this already, I wonder if it would make sense to
> rewrite this example to avoid the dangerous sending of an arbitrary
> string (which might contain %) to a printf-like function. Like this,
> for example:
>
>     trace_printf_key(&trace_foo, "%s", message);

Thanks, will squash in.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-05 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 10:05 [PATCH] api-trace.txt: fix typo Elia Pinto
2016-04-05 17:15 ` Eric Sunshine
2016-04-05 20:49   ` Junio C Hamano

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 NNTP newsgroup(s).