summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index ee43a3c..c16584c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -66,6 +66,16 @@ char *StrCopy(const char *source)
}
+char *SafeStrCopy(char *destination,
+ const char *source,
+ size_t destination_size)
+{
+ strncpy(destination, source, destination_size);
+ destination[destination_size - 1] = 0;
+ return destination;
+}
+
+
const char *Basename(const char *path)
{
const char *p=path+strlen(path);