~ubuntu-branches/debian/sid/flickcurl/sid

« back to all changes in this revision

Viewing changes to src/category.c

  • Committer: Package Import Robot
  • Author(s): Kumar Appaiah
  • Date: 2013-05-20 21:15:09 UTC
  • mfrom: (1.4.1) (15.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130520211509-e701o5dlwa04aqiw
Tags: 1.24-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
    c = (flickcurl_category*)calloc(sizeof(flickcurl_category), 1);
120
120
    
121
121
    for(attr = node->properties; attr; attr = attr->next) {
 
122
      size_t attr_len = strlen((const char*)attr->children->content);
122
123
      const char *attr_name = (const char*)attr->name;
123
124
      char *attr_value;
124
125
 
125
 
      attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1);
126
 
      strcpy(attr_value, (const char*)attr->children->content);
 
126
      attr_value = (char*)malloc(attr_len + 1);
 
127
      memcpy(attr_value, attr->children->content, attr_len + 1);
127
128
      
128
129
      if(!strcmp(attr_name, "id"))
129
130
        c->id = attr_value;
135
136
        c->count = atoi(attr_value);
136
137
        free(attr_value);
137
138
      }
 
139
      else
 
140
        free(attr_value);
138
141
    }
139
142
 
140
143
#if FLICKCURL_DEBUG > 1