aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/parseutils.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-11-02 20:17:25 +0100
committerMartin Storsjö <martin@martin.st>2011-11-06 11:52:57 +0200
commitbb3244dee26e3c500b14830e9500cb2d3658f809 (patch)
tree197235a2c136636ffbeab1464e51a87963ea6e36 /libavutil/parseutils.c
parentba04ecfdacec4cf86e74b43fe8bcc09e06bb7a72 (diff)
downloadffmpeg-bb3244dee26e3c500b14830e9500cb2d3658f809.tar.gz
Replace all usage of strcasecmp/strncasecmp
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: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r--libavutil/parseutils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 1f8f7a8d46..c1647a0e20 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -21,7 +21,6 @@
* misc parsing utilities
*/
-#include <strings.h>
#include <sys/time.h>
#include <time.h>
@@ -294,7 +293,7 @@ static ColorEntry color_table[] = {
static int color_table_compare(const void *lhs, const void *rhs)
{
- return strcasecmp(lhs, ((const ColorEntry *)rhs)->name);
+ return av_strcasecmp(lhs, ((const ColorEntry *)rhs)->name);
}
#define ALPHA_SEP '@'
@@ -320,7 +319,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
len = strlen(color_string2);
rgba_color[3] = 255;
- if (!strcasecmp(color_string2, "random") || !strcasecmp(color_string2, "bikeshed")) {
+ if (!av_strcasecmp(color_string2, "random") || !av_strcasecmp(color_string2, "bikeshed")) {
int rgba = av_get_random_seed();
rgba_color[0] = rgba >> 24;
rgba_color[1] = rgba >> 16;
@@ -515,7 +514,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
p = timestr;
q = NULL;
if (!duration) {
- if (!strncasecmp(timestr, "now", len)) {
+ if (!av_strncasecmp(timestr, "now", len)) {
*timeval = (int64_t) now * 1000000;
return 0;
}