Update of /cvsroot/alsa/alsa-kernel/core/seq/oss
In directory sc8-pr-cvs1:/tmp/cvs-serv31308/core/seq/oss
Modified Files:
seq_oss_midi.c seq_oss_synth.c
Log Message:
Added strlcpy() strlcat() functions
Index: seq_oss_midi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/oss/seq_oss_midi.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- seq_oss_midi.c 2 Apr 2003 10:41:18 -0000 1.12
+++ seq_oss_midi.c 30 May 2003 12:28:34 -0000 1.13
@@ -184,8 +184,7 @@
snd_use_lock_init(&mdev->use_lock);
/* copy and truncate the name of synth device */
- strncpy(mdev->name, pinfo->name, sizeof(mdev->name));
- mdev->name[sizeof(mdev->name) - 1] = 0;
+ strlcpy(mdev->name, pinfo->name, sizeof(mdev->name));
/* create MIDI coder */
if (snd_midi_event_new(MAX_MIDI_EVENT_BUF, &mdev->coder) < 0) {
@@ -659,7 +658,7 @@
inf->device = dev;
inf->dev_type = 0; /* FIXME: ?? */
inf->capabilities = 0; /* FIXME: ?? */
- strncpy(inf->name, mdev->name, sizeof(inf->name));
+ strlcpy(inf->name, mdev->name, sizeof(inf->name));
snd_use_lock_free(&mdev->use_lock);
return 0;
}
Index: seq_oss_synth.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/oss/seq_oss_synth.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- seq_oss_synth.c 20 May 2003 21:43:30 -0000 1.13
+++ seq_oss_synth.c 30 May 2003 12:28:34 -0000 1.14
@@ -117,8 +117,7 @@
snd_use_lock_init(&rec->use_lock);
/* copy and truncate the name of synth device */
- strncpy(rec->name, dev->name, sizeof(rec->name));
- rec->name[sizeof(rec->name)-1] = 0;
+ strlcpy(rec->name, dev->name, sizeof(rec->name));
/* registration */
spin_lock_irqsave(®ister_lock, flags);
@@ -611,7 +610,7 @@
inf->synth_subtype = 0;
inf->nr_voices = 16;
inf->device = dev;
- strncpy(inf->name, minf.name, sizeof(inf->name));
+ strlcpy(inf->name, minf.name, sizeof(inf->name));
} else {
if ((rec = get_synthdev(dp, dev)) == NULL)
return -ENXIO;
@@ -619,7 +618,7 @@
inf->synth_subtype = rec->synth_subtype;
inf->nr_voices = rec->nr_voices;
inf->device = dev;
- strncpy(inf->name, rec->name, sizeof(inf->name));
+ strlcpy(inf->name, rec->name, sizeof(inf->name));
snd_use_lock_free(&rec->use_lock);
}
return 0;
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog