size_t length = strlen(prefix) + strlen(name);
// Allocate a new buffer and write the string into it
- char* buffer = pakfire_malloc(length + 1);
+ char* buffer = malloc(length + 1);
+ if (!buffer)
+ abort();
+
snprintf(buffer, length + 1, "%s%s", prefix, name);
return buffer;
size_t length = strlen("define ") + yyleng;
// Make a copy because unput touches yytext
- char* buffer = pakfire_malloc(length + 1);
+ char* buffer = malloc(length + 1);
+ if (!buffer)
+ abort();
+
snprintf(buffer, length + 1, "define %s", yytext);
// Put the whole string back onto the stack (backwards)
size_t len = strlen(yytext);
yytext[len-1] = '\0';
- yylval.string = pakfire_strdup(yytext + 1);
+ yylval.string = strdup(yytext + 1);
return T_WORD;
}
{word} {
- yylval.string = pakfire_strdup(yytext);
+ yylval.string = strdup(yytext);
return T_WORD;
}