summaryrefslogtreecommitdiffabout
path: root/lib/discovery.cc
authorMichael Krelin <hacker@klever.net>2008-06-27 21:00:41 (UTC)
committer Michael Krelin <hacker@klever.net>2008-06-27 21:00:41 (UTC)
commit362678728b8232c9490e14ba14ff323d9a92d6be (patch) (side-by-side diff)
tree105675f96fff87916b2fdea8b51ad9fe98c5531d /lib/discovery.cc
parenta344edbdddeac51524001faa10d06f85cfdb041c (diff)
downloadlibopkele-362678728b8232c9490e14ba14ff323d9a92d6be.zip
libopkele-362678728b8232c9490e14ba14ff323d9a92d6be.tar.gz
libopkele-362678728b8232c9490e14ba14ff323d9a92d6be.tar.bz2
made gcc 4.3 a bit happier
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'lib/discovery.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/discovery.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/discovery.cc b/lib/discovery.cc
index d1989ec..984e308 100644
--- a/lib/discovery.cc
+++ b/lib/discovery.cc
@@ -330,25 +330,25 @@ namespace opkele {
}
size_t header(void *p,size_t s,size_t nm) {
size_t bytes = s*nm;
const char *h = (const char*)p;
const char *colon = (const char*)memchr(p,':',bytes);
const char *space = (const char*)memchr(p,' ',bytes);
if(space && ( (!colon) || space<colon ) ) {
xrds_location.clear(); http_content_type.clear();
}else if(colon) {
const char *hv = ++colon;
size_t hnl = colon-h;
int rb;
- for(rb = bytes-hnl-1;rb>0 && isspace(*hv);++hv,--rb);
+ for(rb = bytes-hnl-1;rb>0 && isspace(*hv);++hv,--rb) ;
while(rb>0 && isspace(hv[rb-1])) --rb;
if(rb) {
if( (hnl>=sizeof(XRDS_HEADER))
&& !strncasecmp(h,XRDS_HEADER":",
sizeof(XRDS_HEADER)) ) {
xrds_location.assign(hv,rb);
}else if( (hnl>=sizeof(CT_HEADER))
&& !strncasecmp(h,CT_HEADER":",
sizeof(CT_HEADER)) ) {
const char *sc = (const char*)memchr(
hv,';',rb);
http_content_type.assign(hv,sc?(sc-hv):rb);
@@ -491,25 +491,25 @@ namespace opkele {
l.assign(a[1]);
}
if(heq)
xrds_location = l;
}else if(is_element(n,"link")) {
string rels;
string href;
for(;*a;a+=2) {
if( !strcasecmp(a[0],"rel") ) {
rels.assign(a[1]);
}else if( !strcasecmp(a[0],"href") ) {
const char *ns = a[1];
- for(;*ns && isspace(*ns);++ns);
+ for(;*ns && isspace(*ns);++ns) ;
href.assign(ns);
string::size_type lns=href.find_last_not_of(data::_whitespace_chars);
href.erase(lns+1);
}
}
for(string::size_type ns=rels.find_first_not_of(data::_whitespace_chars);
ns!=string::npos; ns=rels.find_first_not_of(data::_whitespace_chars,ns)) {
string::size_type s = rels.find_first_of(data::_whitespace_chars,ns);
string rel;
if(s==string::npos) {
rel.assign(rels,ns,string::npos);
ns = string::npos;