summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev/ce4231.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-11 19:41:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-11 19:41:13 +0000
commitd6d7c738346239a3c708dc0978911e106ff464ef (patch)
treebc43e8e3f9316ebb64d8b2b82353eeccf749cf26 /sys/arch/sparc64/dev/ce4231.c
parent0b07ddfee5e2e357a1085b59936307292adeacfe (diff)
string cleaning; krw ok
Diffstat (limited to 'sys/arch/sparc64/dev/ce4231.c')
-rw-r--r--sys/arch/sparc64/dev/ce4231.c96
1 files changed, 56 insertions, 40 deletions
diff --git a/sys/arch/sparc64/dev/ce4231.c b/sys/arch/sparc64/dev/ce4231.c
index a09ad77b145..cbbe9ebf063 100644
--- a/sys/arch/sparc64/dev/ce4231.c
+++ b/sys/arch/sparc64/dev/ce4231.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ce4231.c,v 1.12 2003/02/17 01:29:19 henric Exp $ */
+/* $OpenBSD: ce4231.c,v 1.13 2003/05/11 19:41:12 deraadt Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -516,55 +516,55 @@ ce4231_query_encoding(addr, fp)
switch (fp->index) {
case 0:
- strcpy(fp->name, AudioEmulaw);
+ strlcpy(fp->name, AudioEmulaw, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
case 1:
- strcpy(fp->name, AudioEalaw);
+ strlcpy(fp->name, AudioEalaw, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ALAW;
fp->precision = 8;
fp->flags = 0;
break;
case 2:
- strcpy(fp->name, AudioEslinear_le);
+ strlcpy(fp->name, AudioEslinear_le, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_SLINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
case 3:
- strcpy(fp->name, AudioEulinear);
+ strlcpy(fp->name, AudioEulinear, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ULINEAR;
fp->precision = 8;
fp->flags = 0;
break;
case 4:
- strcpy(fp->name, AudioEslinear_be);
+ strlcpy(fp->name, AudioEslinear_be, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_SLINEAR_BE;
fp->precision = 16;
fp->flags = 0;
break;
case 5:
- strcpy(fp->name, AudioEslinear);
+ strlcpy(fp->name, AudioEslinear, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_SLINEAR;
fp->precision = 8;
fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
break;
case 6:
- strcpy(fp->name, AudioEulinear_le);
+ strlcpy(fp->name, AudioEulinear_le, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ULINEAR_LE;
fp->precision = 16;
fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
break;
case 7:
- strcpy(fp->name, AudioEulinear_be);
+ strlcpy(fp->name, AudioEulinear_be, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ULINEAR_BE;
fp->precision = 16;
fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
break;
case 8:
- strcpy(fp->name, AudioEadpcm);
+ strlcpy(fp->name, AudioEadpcm, sizeof fp->name);
fp->encoding = AUDIO_ENCODING_ADPCM;
fp->precision = 8;
fp->flags = 0;
@@ -1135,54 +1135,60 @@ ce4231_query_devinfo(addr, dip)
dip->mixer_class = CSAUDIO_INPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_MIC_MUTE;
- strcpy(dip->label.name, AudioNmicrophone);
+ strlcpy(dip->label.name, AudioNmicrophone, sizeof dip->label.name);
dip->un.v.num_channels = 1;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_DAC_LVL: /* dacout */
dip->type = AUDIO_MIXER_VALUE;
dip->mixer_class = CSAUDIO_INPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_DAC_MUTE;
- strcpy(dip->label.name, AudioNdac);
+ strlcpy(dip->label.name, AudioNdac, sizeof dip->label.name);
dip->un.v.num_channels = 2;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_LINE_IN_LVL: /* line */
dip->type = AUDIO_MIXER_VALUE;
dip->mixer_class = CSAUDIO_INPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_LINE_IN_MUTE;
- strcpy(dip->label.name, AudioNline);
+ strlcpy(dip->label.name, AudioNline, sizeof dip->label.name);
dip->un.v.num_channels = 2;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_CD_LVL: /* cd */
dip->type = AUDIO_MIXER_VALUE;
dip->mixer_class = CSAUDIO_INPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_CD_MUTE;
- strcpy(dip->label.name, AudioNcd);
+ strlcpy(dip->label.name, AudioNcd, sizeof dip->label.name);
dip->un.v.num_channels = 2;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_MONITOR_LVL: /* monitor level */
dip->type = AUDIO_MIXER_VALUE;
dip->mixer_class = CSAUDIO_MONITOR_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_MONITOR_MUTE;
- strcpy(dip->label.name, AudioNmonitor);
+ strlcpy(dip->label.name, AudioNmonitor, sizeof dip->label.name);
dip->un.v.num_channels = 1;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_OUTPUT_LVL:
dip->type = AUDIO_MIXER_VALUE;
dip->mixer_class = CSAUDIO_OUTPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_OUTPUT_MUTE;
- strcpy(dip->label.name, AudioNoutput);
+ strlcpy(dip->label.name, AudioNoutput, sizeof dip->label.name);
dip->un.v.num_channels = 2;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_LINE_IN_MUTE:
dip->type = AUDIO_MIXER_ENUM;
@@ -1222,11 +1228,13 @@ ce4231_query_devinfo(addr, dip)
goto mute;
mute:
- strcpy(dip->label.name, AudioNmute);
+ strlcpy(dip->label.name, AudioNmute, sizeof dip->label.name);
dip->un.e.num_mem = 2;
- strcpy(dip->un.e.member[0].label.name, AudioNon);
+ strlcpy(dip->un.e.member[0].label.name, AudioNon,
+ sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = 0;
- strcpy(dip->un.e.member[1].label.name, AudioNoff);
+ strlcpy(dip->un.e.member[1].label.name, AudioNoff,
+ sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = 1;
break;
case CSAUDIO_REC_LVL: /* record level */
@@ -1234,37 +1242,45 @@ ce4231_query_devinfo(addr, dip)
dip->mixer_class = CSAUDIO_RECORD_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = CSAUDIO_RECORD_SOURCE;
- strcpy(dip->label.name, AudioNrecord);
+ strlcpy(dip->label.name, AudioNrecord, sizeof dip->label.name);
dip->un.v.num_channels = 2;
- strcpy(dip->un.v.units.name, AudioNvolume);
+ strlcpy(dip->un.v.units.name, AudioNvolume,
+ sizeof dip->un.v.units.name);
break;
case CSAUDIO_RECORD_SOURCE:
dip->type = AUDIO_MIXER_ENUM;
dip->mixer_class = CSAUDIO_RECORD_CLASS;
dip->prev = CSAUDIO_REC_LVL;
dip->next = AUDIO_MIXER_LAST;
- strcpy(dip->label.name, AudioNsource);
+ strlcpy(dip->label.name, AudioNsource, sizeof dip->label.name);
dip->un.e.num_mem = 3;
- strcpy(dip->un.e.member[0].label.name, AudioNcd);
+ strlcpy(dip->un.e.member[0].label.name, AudioNcd,
+ sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = DAC_IN_PORT;
- strcpy(dip->un.e.member[1].label.name, AudioNmicrophone);
+ strlcpy(dip->un.e.member[1].label.name, AudioNmicrophone,
+ sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = MIC_IN_PORT;
- strcpy(dip->un.e.member[2].label.name, AudioNdac);
+ strlcpy(dip->un.e.member[2].label.name, AudioNdac,
+ sizeof dip->un.e.member[2].label.name);
dip->un.e.member[2].ord = AUX1_IN_PORT;
- strcpy(dip->un.e.member[3].label.name, AudioNline);
+ strlcpy(dip->un.e.member[3].label.name, AudioNline,
+ sizeof dip->un.e.member[3].label.name);
dip->un.e.member[3].ord = LINE_IN_PORT;
break;
case CSAUDIO_OUTPUT:
dip->type = AUDIO_MIXER_ENUM;
dip->mixer_class = CSAUDIO_MONITOR_CLASS;
dip->prev = dip->next = AUDIO_MIXER_LAST;
- strcpy(dip->label.name, AudioNoutput);
+ strlcpy(dip->label.name, AudioNoutput, sizeof dip->label.name);
dip->un.e.num_mem = 3;
- strcpy(dip->un.e.member[0].label.name, AudioNspeaker);
+ strlcpy(dip->un.e.member[0].label.name, AudioNspeaker,
+ sizeof dip->un.e.member[0].label.name);
dip->un.e.member[0].ord = CSPORT_SPEAKER;
- strcpy(dip->un.e.member[1].label.name, AudioNline);
+ strlcpy(dip->un.e.member[1].label.name, AudioNline,
+ sizeof dip->un.e.member[1].label.name);
dip->un.e.member[1].ord = CSPORT_LINEOUT;
- strcpy(dip->un.e.member[2].label.name, AudioNheadphone);
+ strlcpy(dip->un.e.member[2].label.name, AudioNheadphone,
+ sizeof dip->un.e.member[2].label.name);
dip->un.e.member[2].ord = CSPORT_HEADPHONE;
break;
case CSAUDIO_INPUT_CLASS: /* input class descriptor */
@@ -1272,28 +1288,28 @@ ce4231_query_devinfo(addr, dip)
dip->mixer_class = CSAUDIO_INPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = AUDIO_MIXER_LAST;
- strcpy(dip->label.name, AudioCinputs);
+ strlcpy(dip->label.name, AudioCinputs, sizeof dip->label.name);
break;
case CSAUDIO_OUTPUT_CLASS: /* output class descriptor */
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = CSAUDIO_OUTPUT_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = AUDIO_MIXER_LAST;
- strcpy(dip->label.name, AudioCoutputs);
+ strlcpy(dip->label.name, AudioCoutputs, sizeof dip->label.name);
break;
case CSAUDIO_MONITOR_CLASS: /* monitor class descriptor */
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = CSAUDIO_MONITOR_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = AUDIO_MIXER_LAST;
- strcpy(dip->label.name, AudioCmonitor);
+ strlcpy(dip->label.name, AudioCmonitor, sizeof dip->label.name);
break;
case CSAUDIO_RECORD_CLASS: /* record class descriptor */
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = CSAUDIO_RECORD_CLASS;
dip->prev = AUDIO_MIXER_LAST;
dip->next = AUDIO_MIXER_LAST;
- strcpy(dip->label.name, AudioCrecord);
+ strlcpy(dip->label.name, AudioCrecord, sizeof dip->label.name);
break;
default:
err = ENXIO;