Changeset 56


Ignore:
Timestamp:
Dec 23, 2010, 4:42:06 PM (9 years ago)
Author:
anonymous
Message:

Add length testing for maps and map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/service.h

    r26 r56  
    133133    map* tmp=m;
    134134    while(tmp!=NULL){
    135       if(strncasecmp(tmp->name,key,strlen(key))==0)
     135      if(strlen(tmp->name)==strlen(key) && strncasecmp(tmp->name,key,strlen(key))==0)
    136136        return true;
    137137      tmp=tmp->next;
     
    146146    maps* tmp=m;
    147147    while(tmp!=NULL){
    148       if(strncasecmp(tmp->name,key,strlen(key))==0){
     148      if(strlen(tmp->name)==strlen(key) && strncasecmp(tmp->name,key,strlen(key))==0){
    149149        return tmp;
    150150      }
     
    157157    map* tmp=m;
    158158    while(tmp!=NULL){
    159       if(strncasecmp(tmp->name,key,strlen(key))==0){
     159      if(strlen(tmp->name)==strlen(key) && strncasecmp(tmp->name,key,strlen(key))==0){
    160160        return tmp;
    161161      }
     
    239239    elements* tmp=e;
    240240    while(tmp!=NULL){
    241       if(strncasecmp(key,tmp->name,strlen(key))==0)
     241      if(strlen(tmp->name)==strlen(key) && strncasecmp(key,tmp->name,strlen(key))==0)
    242242        return true;
    243243      tmp=tmp->next;
     
    249249    elements* tmp=m;
    250250    while(tmp!=NULL){
    251       if(strncasecmp(tmp->name,key,strlen(tmp->name))==0)
     251      if(strlen(tmp->name)==strlen(key) && strncasecmp(tmp->name,key,strlen(tmp->name))==0)
    252252        return tmp;
    253253      tmp=tmp->next;
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png