Revised handling of file names & paths

This commit is contained in:
Bert
2011-08-18 00:38:55 +02:00
parent 2a3a9657d3
commit ff013dd009
10 changed files with 101 additions and 82 deletions

11
util.c
View File

@ -47,6 +47,17 @@ void* s_realloc(void *ptr, size_t size) {
return ptr;
}
char* s_strdup(char *s) {
char *d = NULL;
if (s) {
if (!(d = malloc(strlen(s) + 1)))
die("could not allocate memory");
strcpy(d, s);
}
return d;
}
void warn(const char* fmt, ...) {
va_list args;