summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_str.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-09 17:51:40 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-09 17:51:40 +0200
commit902d66eb8304ccffdb683b7130e9f548011b8d30 (patch)
tree9cdd73b5f68131ba2d4944d17e183b4313bdb559 /src/demuxers/demux_str.c
parenta51427608e2f4543ae0cb0598517a1e4f6b0928b (diff)
downloadxine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.gz
xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.bz2
Avoid loop for common memory operations (zeroing, copying, moving).
Use the proper function for common memory operations (memset() for zeroing, memcpy() for copying, memmove() for moving), instead of looping through arrays. By extension, remove loops to reset arrays when they were allocated with calloc() and thus already zeroed.
Diffstat (limited to 'src/demuxers/demux_str.c')
-rw-r--r--src/demuxers/demux_str.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c
index 97e025504..1e750f183 100644
--- a/src/demuxers/demux_str.c
+++ b/src/demuxers/demux_str.c
@@ -188,9 +188,7 @@ static int open_str_file(demux_str_t *this) {
unsigned char check_bytes[STR_CHECK_BYTES];
int local_offset, sector, channel;
- for (channel = 0; channel < STR_MAX_CHANNELS; channel++) {
- this->channel_type[channel] = 0;
- }
+ memset(this->channel_type, 0, sizeof(this->channel_type));
this->input->seek(this->input, 0, SEEK_SET);
if (this->input->read(this->input, check_bytes, STR_CHECK_BYTES) !=