diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-27 11:22:55 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-27 11:22:55 +0000 |
commit | c670c56d6bb9915caf18009083d3515283a25fe1 (patch) | |
tree | ffee78ad4ad468acbebd70d511be258d28fdbd52 /sys/dev/pci/eap.c | |
parent | c9c7d16545b1bfad4519f491aa113a57ab7c7b2d (diff) |
strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.
Diffstat (limited to 'sys/dev/pci/eap.c')
-rw-r--r-- | sys/dev/pci/eap.c | 110 |
1 files changed, 67 insertions, 43 deletions
diff --git a/sys/dev/pci/eap.c b/sys/dev/pci/eap.c index f150af1a7ab..b3cb79e8b04 100644 --- a/sys/dev/pci/eap.c +++ b/sys/dev/pci/eap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eap.c,v 1.18 2003/04/05 19:15:52 millert Exp $ */ +/* $OpenBSD: eap.c,v 1.19 2003/04/27 11:22:53 ho Exp $ */ /* $NetBSD: eap.c,v 1.46 2001/09/03 15:07:37 reinoud Exp $ */ /* @@ -834,49 +834,49 @@ eap_query_encoding(void *addr, struct audio_encoding *fp) { switch (fp->index) { case 0: - strcpy(fp->name, AudioEulinear); + strlcpy(fp->name, AudioEulinear, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULINEAR; fp->precision = 8; fp->flags = 0; return (0); case 1: - strcpy(fp->name, AudioEmulaw); + strlcpy(fp->name, AudioEmulaw, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULAW; fp->precision = 8; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; return (0); case 2: - strcpy(fp->name, AudioEalaw); + strlcpy(fp->name, AudioEalaw, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ALAW; fp->precision = 8; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; return (0); case 3: - strcpy(fp->name, AudioEslinear); + strlcpy(fp->name, AudioEslinear, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR; fp->precision = 8; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; return (0); case 4: - 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; return (0); case 5: - 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; return (0); case 6: - strcpy(fp->name, AudioEslinear_be); + strlcpy(fp->name, AudioEslinear_be, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR_BE; fp->precision = 16; fp->flags = AUDIO_ENCODINGFLAG_EMULATED; return (0); 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; @@ -1408,100 +1408,121 @@ eap1370_query_devinfo(void *addr, mixer_devinfo_t *dip) dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_OUTPUT_CLASS; dip->prev = dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNmaster); + strlcpy(dip->label.name, AudioNmaster, 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); return (0); case EAP_VOICE_VOL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_INPUT_CLASS; dip->prev = AUDIO_MIXER_LAST; dip->next = AUDIO_MIXER_LAST; - 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); return (0); case EAP_FM_VOL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_INPUT_CLASS; dip->prev = AUDIO_MIXER_LAST; dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNfmsynth); + strlcpy(dip->label.name, AudioNfmsynth, + 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); return (0); case EAP_CD_VOL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_INPUT_CLASS; dip->prev = AUDIO_MIXER_LAST; dip->next = AUDIO_MIXER_LAST; - 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); return (0); case EAP_LINE_VOL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_INPUT_CLASS; dip->prev = AUDIO_MIXER_LAST; dip->next = AUDIO_MIXER_LAST; - 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); return (0); case EAP_AUX_VOL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_INPUT_CLASS; dip->prev = AUDIO_MIXER_LAST; dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNaux); + strlcpy(dip->label.name, AudioNaux, 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); return (0); case EAP_MIC_VOL: dip->type = AUDIO_MIXER_VALUE; dip->mixer_class = EAP_INPUT_CLASS; dip->prev = AUDIO_MIXER_LAST; dip->next = EAP_MIC_PREAMP; - 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); return (0); case EAP_RECORD_SOURCE: dip->mixer_class = EAP_RECORD_CLASS; dip->prev = dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNsource); + strlcpy(dip->label.name, AudioNsource, sizeof dip->label.name); dip->type = AUDIO_MIXER_SET; dip->un.s.num_mem = 6; - strcpy(dip->un.s.member[0].label.name, AudioNmicrophone); + strlcpy(dip->un.s.member[0].label.name, AudioNmicrophone, + sizeof dip->un.s.member[0].label.name); dip->un.s.member[0].mask = 1 << EAP_MIC_VOL; - strcpy(dip->un.s.member[1].label.name, AudioNcd); + strlcpy(dip->un.s.member[1].label.name, AudioNcd, + sizeof dip->un.s.member[1].label.name); dip->un.s.member[1].mask = 1 << EAP_CD_VOL; - strcpy(dip->un.s.member[2].label.name, AudioNline); + strlcpy(dip->un.s.member[2].label.name, AudioNline, + sizeof dip->un.s.member[2].label.name); dip->un.s.member[2].mask = 1 << EAP_LINE_VOL; - strcpy(dip->un.s.member[3].label.name, AudioNfmsynth); + strlcpy(dip->un.s.member[3].label.name, AudioNfmsynth, + sizeof dip->un.s.member[3].label.name); dip->un.s.member[3].mask = 1 << EAP_FM_VOL; - strcpy(dip->un.s.member[4].label.name, AudioNaux); + strlcpy(dip->un.s.member[4].label.name, AudioNaux, + sizeof dip->un.s.member[4].label.name); dip->un.s.member[4].mask = 1 << EAP_AUX_VOL; - strcpy(dip->un.s.member[5].label.name, AudioNdac); + strlcpy(dip->un.s.member[5].label.name, AudioNdac, + sizeof dip->un.s.member[5].label.name); dip->un.s.member[5].mask = 1 << EAP_VOICE_VOL; return (0); case EAP_OUTPUT_SELECT: dip->mixer_class = EAP_OUTPUT_CLASS; dip->prev = dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNselect); + strlcpy(dip->label.name, AudioNselect, sizeof dip->label.name); dip->type = AUDIO_MIXER_SET; dip->un.s.num_mem = 6; - strcpy(dip->un.s.member[0].label.name, AudioNmicrophone); + strlcpy(dip->un.s.member[0].label.name, AudioNmicrophone, + sizeof dip->un.s.member[0].label.name); dip->un.s.member[0].mask = 1 << EAP_MIC_VOL; - strcpy(dip->un.s.member[1].label.name, AudioNcd); + strlcpy(dip->un.s.member[1].label.name, AudioNcd, + sizeof dip->un.s.member[1].label.name); dip->un.s.member[1].mask = 1 << EAP_CD_VOL; - strcpy(dip->un.s.member[2].label.name, AudioNline); + strlcpy(dip->un.s.member[2].label.name, AudioNline, + sizeof dip->un.s.member[2].label.name); dip->un.s.member[2].mask = 1 << EAP_LINE_VOL; - strcpy(dip->un.s.member[3].label.name, AudioNfmsynth); + strlcpy(dip->un.s.member[3].label.name, AudioNfmsynth, + sizeof dip->un.s.member[3].label.name); dip->un.s.member[3].mask = 1 << EAP_FM_VOL; - strcpy(dip->un.s.member[4].label.name, AudioNaux); + strlcpy(dip->un.s.member[4].label.name, AudioNaux, + sizeof dip->un.s.member[4].label.name); dip->un.s.member[4].mask = 1 << EAP_AUX_VOL; - strcpy(dip->un.s.member[5].label.name, AudioNdac); + strlcpy(dip->un.s.member[5].label.name, AudioNdac, + sizeof dip->un.s.member[5].label.name); dip->un.s.member[5].mask = 1 << EAP_VOICE_VOL; return (0); case EAP_MIC_PREAMP: @@ -1509,30 +1530,33 @@ eap1370_query_devinfo(void *addr, mixer_devinfo_t *dip) dip->mixer_class = EAP_INPUT_CLASS; dip->prev = EAP_MIC_VOL; dip->next = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioNpreamp); + strlcpy(dip->label.name, AudioNpreamp, sizeof dip->label.name); dip->un.e.num_mem = 2; - strcpy(dip->un.e.member[0].label.name, AudioNoff); + strlcpy(dip->un.e.member[0].label.name, AudioNoff, + sizeof dip->un.e.member[0].label.name); dip->un.e.member[0].ord = 0; - strcpy(dip->un.e.member[1].label.name, AudioNon); + strlcpy(dip->un.e.member[1].label.name, AudioNon, + sizeof dip->un.e.member[1].label.name); dip->un.e.member[1].ord = 1; return (0); case EAP_OUTPUT_CLASS: dip->type = AUDIO_MIXER_CLASS; dip->mixer_class = EAP_OUTPUT_CLASS; dip->next = dip->prev = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioCoutputs); + strlcpy(dip->label.name, AudioCoutputs, + sizeof dip->label.name); return (0); case EAP_RECORD_CLASS: dip->type = AUDIO_MIXER_CLASS; dip->mixer_class = EAP_RECORD_CLASS; dip->next = dip->prev = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioCrecord); + strlcpy(dip->label.name, AudioCrecord, sizeof dip->label.name); return (0); case EAP_INPUT_CLASS: dip->type = AUDIO_MIXER_CLASS; dip->mixer_class = EAP_INPUT_CLASS; dip->next = dip->prev = AUDIO_MIXER_LAST; - strcpy(dip->label.name, AudioCinputs); + strlcpy(dip->label.name, AudioCinputs, sizeof dip->label.name); return (0); } return (ENXIO); |