diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-01 15:29:06 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-01 15:29:06 +0000 |
commit | d138c4ab32e2b4a3c527ad12b4c10a3527472289 (patch) | |
tree | f84f74e49a234d5915c0ed97f08867d99c2b1e20 /src/charset | |
parent | e75a0c7c08cc0a0864185bdf155c934526a212ac (diff) | |
download | libcss-d138c4ab32e2b4a3c527ad12b4c10a3527472289.tar.gz |
Ensure that charset detection always returns CSS_OK unless there's a fatal error. Otherwise, it's possible to fail to process any of a short stylesheet (sheet.length < "@charset ").
svn path=/trunk/libcss/; revision=8241
Diffstat (limited to 'src/charset')
-rw-r--r-- | src/charset/detect.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/charset/detect.c b/src/charset/detect.c index 2612fa8..9f8da69 100644 --- a/src/charset/detect.c +++ b/src/charset/detect.c @@ -144,10 +144,8 @@ parserutils_error css_charset_read_bom_or_charset(const uint8_t *data, } error = try_ascii_compatible_charset(data, len, &charset); - if (error != PARSERUTILS_OK) - return error; - - *mibenum = charset; + if (error == PARSERUTILS_OK) + *mibenum = charset; return PARSERUTILS_OK; } |