From 96949dafcca87f65902bd77a0bc56007d9cead70 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Wed, 2 Nov 2011 20:17:25 +0100 Subject: Replace all strcasecmp/strncasecmp usages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All current usages of it are incompatible with localization. For example strcasecmp("i", "I") != 0 is possible, but would break many of the places where it is used. Instead use our own implementations that always treat the data as ASCII. Signed-off-by: Reimar Döffinger --- libavformat/img2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libavformat/img2.c') diff --git a/libavformat/img2.c b/libavformat/img2.c index 7b89a9c980..444a6dfd7a 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -29,7 +29,6 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" -#include typedef struct { const AVClass *class; /**< Class for private options. */ @@ -125,7 +124,7 @@ static enum CodecID av_str2id(const IdStrMap *tags, const char *str) str++; while (tags->id) { - if (!strcasecmp(str, tags->str)) + if (!av_strcasecmp(str, tags->str)) return tags->id; tags++; @@ -281,7 +280,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) st->codec->codec_id = s1->audio_codec_id; }else{ const char *str= strrchr(s->path, '.'); - s->split_planes = str && !strcasecmp(str + 1, "y"); + s->split_planes = str && !av_strcasecmp(str + 1, "y"); st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = av_str2id(img_tags, s->path); } @@ -377,7 +376,7 @@ static int write_header(AVFormatContext *s) img->is_pipe = 1; str = strrchr(img->path, '.'); - img->split_planes = str && !strcasecmp(str + 1, "y"); + img->split_planes = str && !av_strcasecmp(str + 1, "y"); return 0; } -- cgit v1.2.3