Ignore:
Timestamp:
Jan 6, 2011, 10:50:56 PM (13 years ago)
Author:
djay
Message:

Small fix for binary string support in dupMaps function to ensure that the binary value willbe passed to various laguages correctly. Memory cleanup.

File:
1 edited

Legend:

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

    r57 r59  
    418418      res->next=NULL;
    419419      map* mc=_cursor->content;
     420      map* tmp=getMap(mc,"size");
     421      char* tmpSized=NULL;
     422      if(tmp!=NULL){
     423        map* tmpV=getMap(mc,"value");
     424        tmpSized=(char*)malloc((atoi(tmp->value)+1)*sizeof(char));
     425        memmove(tmpSized,tmpV->value,atoi(tmp->value)*sizeof(char));
     426      }
    420427      if(mc!=NULL){
    421428        addMapToMap(&res->content,mc);
     429      }
     430      if(tmp!=NULL){
     431        map* tmpV=getMap(res->content,"value");
     432        free(tmpV->value);
     433        tmpV->value=(char*)malloc(atoi(tmp->value)*sizeof(char));
     434        memmove(tmpV->value,tmpSized,atoi(tmp->value)*sizeof(char));
     435        free(tmpSized);
    422436      }
    423437      res->next=dupMaps(&_cursor->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