diff options
author | nicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-10-06 17:23:21 +0000 |
---|---|---|
committer | nicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-10-06 17:23:21 +0000 |
commit | 6a16d1f0ee87ab190a977105397169a241317e56 (patch) | |
tree | ee4552705b4720e72edc4e8e0c8cff7e284b4ffb | |
parent | e281d7946a86cb12197de2fba553361c8b278fc9 (diff) | |
download | libproxy-6a16d1f0ee87ab190a977105397169a241317e56.tar.gz |
Avoid sending negative values to isalnum()
On Windows, sending negative value to isalnum() result in an assertion
popping. Adding cast, to prevent negative value from being sent.
git-svn-id: http://libproxy.googlecode.com/svn/trunk@772 c587cffe-e639-0410-9787-d7902ae8ed56
-rw-r--r-- | libproxy/url.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libproxy/url.cpp b/libproxy/url.cpp index f8bac03..ea9fc8b 100644 --- a/libproxy/url.cpp +++ b/libproxy/url.cpp @@ -110,7 +110,7 @@ bool url::is_valid(const string url_) { string url::encode(const string &data, const string &valid_reserved) { ostringstream encoded; for (unsigned int i=0; i < data.size(); i++) { - if (isalnum(data[i]) + if (isalnum((unsigned char)data[i]) || valid_reserved.find(data[i]) != string::npos || string("-._~").find(data[i]) != string::npos) encoded << data[i]; |