diff options
author | Bert <ber.t@gmx.com> | 2011-08-18 00:38:55 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-08-18 00:38:55 +0200 |
commit | ff013dd0092df247b2c9f1c550e03542581ed21d (patch) | |
tree | 572777f9576c65c63a6f520e3b8b5b85edf5d580 /util.c | |
parent | 2a3a9657d360a4952ef84aa4e8665f211d490321 (diff) |
Revised handling of file names & paths
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; |