Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | Date | Sun, 25 May 2003 13:34:06 -0400 | From | Ben Collins <> | Subject | [PATCH] Fix snd_seq_queue_find_name() |
| |
While going through sound/ for strncpy replacing, I came across this routine:
/* return the (first) queue matching with the specified name */ queue_t *snd_seq_queue_find_name(char *name) { int i; queue_t *q;
for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) { if ((q = queueptr(i)) != NULL) { if (strncpy(q->name, name, sizeof(q->name)) == 0) return q; queuefree(q); } } return NULL; }
I'm _really_ sure that they meant to use strncmp() here instead. Patch below fixes it.
Index: sound/core/seq/seq_queue.c =================================================================== --- sound/core/seq/seq_queue.c (revision 10041) +++ sound/core/seq/seq_queue.c (working copy) @@ -241,7 +241,7 @@ for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) { if ((q = queueptr(i)) != NULL) { - if (strncpy(q->name, name, sizeof(q->name)) == 0) + if (strncmp(q->name, name, sizeof(q->name)) == 0) return q; queuefree(q); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |