return NULL;
}
while(raw && *raw){
- depends = (char **)realloc(depends, sizeof(char *) * (line_count + 1));
+ depends = xrealloc(depends, sizeof(char *) * (line_count + 1));
while(isspace(*raw)) raw++;
if (!pkg->version)
{
- pkg->version= calloc(1, strlen(raw)+1);
- if ( pkg->version == NULL ) {
- fprintf(stderr, "%s: out of memory \n", __FUNCTION__);
- return ENOMEM;
- }
- strcpy(pkg->version, raw);
+ pkg->version= xcalloc(1, strlen(raw)+1);
+ strcpy(pkg->version, raw);
}
hyphen= strrchr(pkg->version,'-');
pkg->priority = parseGenericFieldType("Priority", *lines);
else if(isGenericFieldType("Provides", *lines)){
/* Here we add the internal_use to align the off by one problem between provides_str and provides */
- provide = (char * ) calloc(1, strlen(*lines)+ 35 ); /* Preparing the space for the new opkg_internal_use_only */
+ provide = xcalloc(1, strlen(*lines)+ 35 ); /* Preparing the space for the new opkg_internal_use_only */
if ( alterProvidesLine(*lines,provide) ){
return EINVAL;
}
case ' ':
if(reading_description) {
/* we already know it's not blank, so the rest of description */
- pkg->description = realloc(pkg->description,
+ pkg->description = xrealloc(pkg->description,
strlen(pkg->description)
+ 1 + strlen(*lines) + 1);
strcat(pkg->description, "\n");
if ( pkg_false_provides==1)
{
pkg->provides_count = 1;
- pkg->provides_str = calloc (1, sizeof (char*));
+ pkg->provides_str = xcalloc(1, sizeof (char*));
pkg->provides_str[0] = xstrdup("opkg_internal_use_only");
}