diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-13 16:51:53 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-13 16:51:53 +0100 |
commit | ce3ce6f01fe1ecae43e8c49a6a8047ade592b603 (patch) | |
tree | 4ae69557ef741a880fed31f442698aee8b6ab03b /src | |
parent | 5d32ff5f16722a31c55fbdb07f3c879e155d63b5 (diff) | |
download | xine-lib-ce3ce6f01fe1ecae43e8c49a6a8047ade592b603.tar.gz xine-lib-ce3ce6f01fe1ecae43e8c49a6a8047ade592b603.tar.bz2 |
Replace strncmp and strncpy with memcmp and memcpy where applicable.
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_film.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_ipmovie.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_qt.c | 10 | ||||
-rw-r--r-- | src/demuxers/demux_voc.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index b22dc4b0f..d09f8f4f1 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -141,7 +141,7 @@ static int open_film_file(demux_film_t *film) { return 0; /* FILM signature correct? */ - if (strncmp(scratch, "FILM", 4)) { + if (memcmp(scratch, "FILM", 4)) { return 0; } llprintf(DEBUG_FILM_LOAD, "found 'FILM' signature\n"); @@ -154,7 +154,7 @@ static int open_film_file(demux_film_t *film) { film_header = xine_xmalloc(film_header_size); if (!film_header) return 0; - strncpy(film->version, &scratch[8], 4); + memcpy(film->version, &scratch[8], 4); llprintf(DEBUG_FILM_LOAD, "0x%X header bytes, version %c%c%c%c\n", film_header_size, film->version[0], diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c index 46c4689ad..cc71da6d4 100644 --- a/src/demuxers/demux_ipmovie.c +++ b/src/demuxers/demux_ipmovie.c @@ -531,7 +531,7 @@ static int open_ipmovie_file(demux_ipmovie_t *this) { IPMOVIE_SIGNATURE_SIZE) return 0; - if (strncmp(signature, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0) + if (memcmp(signature, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0) return 0; /* file is qualified; skip over the signature bytes (+ 6 unknown) in the stream */ diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 3d05a953f..951702dd8 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -1627,7 +1627,7 @@ static qt_error parse_reference_atom (reference_t *ref, /* URL is spec'd to terminate with a NULL; don't trust it */ ref->url = xine_xmalloc(_X_BE_32(&ref_atom[i + 12]) + 1); - strncpy(ref->url, &ref_atom[i + 16], _X_BE_32(&ref_atom[i + 12])); + memcpy(ref->url, &ref_atom[i + 16], _X_BE_32(&ref_atom[i + 12])); ref->url[_X_BE_32(&ref_atom[i + 12]) - 1] = '\0'; } else { @@ -2039,28 +2039,28 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom, case NAM_ATOM: string_size = _X_BE_16(&moov_atom[i + 4]) + 1; info->name = realloc (info->name, string_size); - strncpy(info->name, &moov_atom[i + 8], string_size - 1); + memcpy(info->name, &moov_atom[i + 8], string_size - 1); info->name[string_size - 1] = 0; break; case CPY_ATOM: string_size = _X_BE_16(&moov_atom[i + 4]) + 1; info->copyright = realloc (info->copyright, string_size); - strncpy(info->copyright, &moov_atom[i + 8], string_size - 1); + memcpy(info->copyright, &moov_atom[i + 8], string_size - 1); info->copyright[string_size - 1] = 0; break; case DES_ATOM: string_size = _X_BE_16(&moov_atom[i + 4]) + 1; info->description = realloc (info->description, string_size); - strncpy(info->description, &moov_atom[i + 8], string_size - 1); + memcpy(info->description, &moov_atom[i + 8], string_size - 1); info->description[string_size - 1] = 0; break; case CMT_ATOM: string_size = _X_BE_16(&moov_atom[i + 4]) + 1; info->comment = realloc (info->comment, string_size); - strncpy(info->comment, &moov_atom[i + 8], string_size - 1); + memcpy(info->comment, &moov_atom[i + 8], string_size - 1); info->comment[string_size - 1] = 0; break; diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index 528d7972b..ffd904a6f 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -85,7 +85,7 @@ static int open_voc_file(demux_voc_t *this) { return 0; /* check the signature */ - if (strncmp(header, VOC_SIGNATURE, strlen(VOC_SIGNATURE)) != 0) + if (memcmp(header, VOC_SIGNATURE, strlen(VOC_SIGNATURE)) != 0) return 0; /* file is qualified */ |