summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
Diffstat (limited to 'perform')
-rw-r--r--perform/pio_engine.c3
-rw-r--r--perform/sio_engine.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index 87fa82c..d34fe38 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -464,7 +464,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
}
else {
/* We didn't append the prefix yet */
- HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size));
+ HDstrncpy(fullname, prefix, size);
+ fullname[size - 1] = '\0';
}
if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) {
diff --git a/perform/sio_engine.c b/perform/sio_engine.c
index 8539f75..4ce3aa0 100644
--- a/perform/sio_engine.c
+++ b/perform/sio_engine.c
@@ -371,7 +371,8 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
fullname[i] = subdir[j];
} else {
/* We didn't append the prefix yet */
- HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size));
+ HDstrncpy(fullname, prefix, size);
+ fullname[size - 1] = '\0';
}
if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) {