* [Xenomai-core] [PATCH] bug in xnintr_irq_proc()
@ 2008-01-29 13:20 Wolfgang Grandegger
2008-01-29 13:42 ` Philippe Gerum
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Grandegger @ 2008-01-29 13:20 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
Hello,
attached is a fix for a nice bug in xnintr_irq_proc() of Xenomai v2.3.x.
Check for tabs. I have not checked if it's present in recent versions as
well.
Wolfgang.
[-- Attachment #2: xenomai-2.3.x-irq-proc.patch --]
[-- Type: text/x-patch, Size: 837 bytes --]
Index: ksrc/nucleus/intr.c
===================================================================
--- ksrc/nucleus/intr.c (revision 3441)
+++ ksrc/nucleus/intr.c (working copy)
@@ -836,7 +836,7 @@ int xnintr_irq_proc(unsigned int irq, ch
#if defined(CONFIG_XENO_OPT_SHIRQ_LEVEL) || defined(CONFIG_XENO_OPT_SHIRQ_EDGE)
intr = xnirqs[irq].handlers;
if (intr) {
- strcpy(p, " "); p += 8;
+ strcpy(p, " "); p += 4;
do {
*p = ' '; p += 1;
@@ -848,7 +848,7 @@ int xnintr_irq_proc(unsigned int irq, ch
#else /* !CONFIG_XENO_OPT_SHIRQ_LEVEL && !CONFIG_XENO_OPT_SHIRQ_EDGE */
intr = rthal_irq_cookie(&rthal_domain, irq);
if (intr) {
- strcpy(p, " "); p += 9;
+ strcpy(p, " "); p += 5;
strcpy(p, intr->name); p += strlen(intr->name);
}
#endif /* CONFIG_XENO_OPT_SHIRQ_LEVEL || CONFIG_XENO_OPT_SHIRQ_EDGE */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] [PATCH] bug in xnintr_irq_proc()
2008-01-29 13:20 [Xenomai-core] [PATCH] bug in xnintr_irq_proc() Wolfgang Grandegger
@ 2008-01-29 13:42 ` Philippe Gerum
2008-01-29 13:51 ` Wolfgang Grandegger
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Gerum @ 2008-01-29 13:42 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: xenomai-core
Wolfgang Grandegger wrote:
> Hello,
>
> attached is a fix for a nice bug in xnintr_irq_proc() of Xenomai v2.3.x.
Mmf... Thanks.
> Check for tabs. I have not checked if it's present in recent versions as
> well.
Even if a bit overkill, I would even go for something like
p += sprintf(p, "...
just to be sure we won't get hit again.
(or even snprintf() for the paranoïds among us).
>
> Wolfgang.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] [PATCH] bug in xnintr_irq_proc()
2008-01-29 13:42 ` Philippe Gerum
@ 2008-01-29 13:51 ` Wolfgang Grandegger
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Grandegger @ 2008-01-29 13:51 UTC (permalink / raw)
To: rpm; +Cc: xenomai-core
Philippe Gerum wrote:
> Wolfgang Grandegger wrote:
>> Hello,
>>
>> attached is a fix for a nice bug in xnintr_irq_proc() of Xenomai v2.3.x.
>
> Mmf... Thanks.
>
>> Check for tabs. I have not checked if it's present in recent versions as
>> well.
>
> Even if a bit overkill, I would even go for something like
> p += sprintf(p, "...
> just to be sure we won't get hit again.
Yes, and replacing the tabs with "\t" in case we need them. They seem to
be gone in the trunk.
> (or even snprintf() for the paranoïds among us).
Definitely, especially because the name field of xnintr_t is a pointer.
Wolfgang.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-29 13:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29 13:20 [Xenomai-core] [PATCH] bug in xnintr_irq_proc() Wolfgang Grandegger
2008-01-29 13:42 ` Philippe Gerum
2008-01-29 13:51 ` Wolfgang Grandegger
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.