diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-05 22:01:07 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-05 22:01:07 +0000 |
commit | 4c4a1070febe5a140cac0357267af338b9852a7e (patch) | |
tree | d7ed87a85da0733f33ea47c25797f58c25e5e9fc /stream/stream_pvr.c | |
parent | b3d59ea908ce87b3dc50bb9ba0ac81edd4765797 (diff) | |
download | mpv-4c4a1070febe5a140cac0357267af338b9852a7e.tar.bz2 mpv-4c4a1070febe5a140cac0357267af338b9852a7e.tar.xz |
Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpy
instead of plain strlcat/strlcpy
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_pvr.c')
-rw-r--r-- | stream/stream_pvr.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c index c6aa4a2b0a..6bde5df1a5 100644 --- a/stream/stream_pvr.c +++ b/stream/stream_pvr.c @@ -45,6 +45,7 @@ #include "frequencies.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" #define PVR_DEFAULT_DEVICE "/dev/video0" #define PVR_MAX_CONTROLS 10 @@ -232,12 +233,12 @@ copycreate_stationlist (stationlist_t *stationlist, int num) /* transport the channel list data to our extented struct */ stationlist->total = num; - strlcpy (stationlist->name, chanlists[chantab].name, PVR_STATION_NAME_SIZE); + av_strlcpy (stationlist->name, chanlists[chantab].name, PVR_STATION_NAME_SIZE); for (i = 0; i < chanlists[chantab].count; i++) { stationlist->list[i].station[0]= '\0'; /* no station name yet */ - strlcpy (stationlist->list[i].name, + av_strlcpy (stationlist->list[i].name, chanlists[chantab].list[i].name, PVR_STATION_NAME_SIZE); stationlist->list[i].freq = chanlists[chantab].list[i].freq; stationlist->list[i].enabled = 1; /* default enabled */ @@ -324,10 +325,10 @@ set_station (struct pvr_t *pvr, const char *station, } if (station) - strlcpy (pvr->stationlist.list[i].station, + av_strlcpy (pvr->stationlist.list[i].station, station, PVR_STATION_NAME_SIZE); else if (channel) - strlcpy (pvr->stationlist.list[i].station, + av_strlcpy (pvr->stationlist.list[i].station, channel, PVR_STATION_NAME_SIZE); else snprintf (pvr->stationlist.list[i].station, @@ -381,10 +382,10 @@ set_station (struct pvr_t *pvr, const char *station, pvr->stationlist.enabled++; if (station) - strlcpy (pvr->stationlist.list[i].station, + av_strlcpy (pvr->stationlist.list[i].station, station, PVR_STATION_NAME_SIZE); if (channel) - strlcpy (pvr->stationlist.list[i].name, channel, PVR_STATION_NAME_SIZE); + av_strlcpy (pvr->stationlist.list[i].name, channel, PVR_STATION_NAME_SIZE); else snprintf (pvr->stationlist.list[i].name, PVR_STATION_NAME_SIZE, "F %d", freq); @@ -476,10 +477,10 @@ parse_setup_stationlist (struct pvr_t *pvr) if (!sep) continue; /* Wrong syntax, but mplayer should not crash */ - strlcpy (station, sep + 1, PVR_STATION_NAME_SIZE); + av_strlcpy (station, sep + 1, PVR_STATION_NAME_SIZE); sep[0] = '\0'; - strlcpy (channel, tmp, PVR_STATION_NAME_SIZE); + av_strlcpy (channel, tmp, PVR_STATION_NAME_SIZE); while ((sep = strchr (station, '_'))) sep[0] = ' '; |