summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module/module.c2
-rw-r--r--src/eightbit.c2
-rw-r--r--test/GNU/table-from.c2
-rw-r--r--test/GNU/table-to.c2
-rw-r--r--test/iconv.c2
-rw-r--r--test/nullable.c2
-rw-r--r--test/translit.c2
7 files changed, 7 insertions, 7 deletions
diff --git a/module/module.c b/module/module.c
index 591a721..fc8f383 100644
--- a/module/module.c
+++ b/module/module.c
@@ -485,7 +485,7 @@ const char *get_aliases_path(void)
if (ucpath == NULL)
return NULL;
- strncpy(aliases, ucpath, sizeof(aliases));
+ strncpy(aliases, ucpath, sizeof(aliases) - 1);
alen = strlen(ucpath);
#ifndef __riscos__
if (aliases[alen - 1] != '/') {
diff --git a/src/eightbit.c b/src/eightbit.c
index f201f31..8dfdb75 100644
--- a/src/eightbit.c
+++ b/src/eightbit.c
@@ -321,7 +321,7 @@ const char *get_table_path(const char *table)
if (ucpath == NULL)
return NULL;
- strncpy(path, ucpath, sizeof(path));
+ strncpy(path, ucpath, sizeof(path) - 1);
plen = strlen(ucpath);
#ifndef __riscos__
if (path[plen - 1] != '/') {
diff --git a/test/GNU/table-from.c b/test/GNU/table-from.c
index 56a0dab..92300d6 100644
--- a/test/GNU/table-from.c
+++ b/test/GNU/table-from.c
@@ -126,7 +126,7 @@ int main (int argc, char* argv[])
exit(1);
}
- strncpy(aliases, ucpath, sizeof(aliases));
+ strncpy(aliases, ucpath, sizeof(aliases) - 1);
alen = strlen(ucpath);
#ifndef __riscos__
if (aliases[alen - 1] != '/') {
diff --git a/test/GNU/table-to.c b/test/GNU/table-to.c
index 62c30a8..3246428 100644
--- a/test/GNU/table-to.c
+++ b/test/GNU/table-to.c
@@ -59,7 +59,7 @@ int main (int argc, char* argv[])
exit(1);
}
- strncpy(aliases, ucpath, sizeof(aliases));
+ strncpy(aliases, ucpath, sizeof(aliases) - 1);
alen = strlen(ucpath);
#ifndef __riscos__
if (aliases[alen - 1] != '/') {
diff --git a/test/iconv.c b/test/iconv.c
index cd0bfa3..f257782 100644
--- a/test/iconv.c
+++ b/test/iconv.c
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
assert(ucpath != NULL);
- strncpy(aliases, ucpath, sizeof(aliases));
+ strncpy(aliases, ucpath, sizeof(aliases) - 1);
alen = strlen(aliases);
#ifndef __riscos__
if (aliases[alen - 1] != '/') {
diff --git a/test/nullable.c b/test/nullable.c
index c9523f5..2052702 100644
--- a/test/nullable.c
+++ b/test/nullable.c
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
assert(ucpath != NULL);
- strncpy(aliases, ucpath, sizeof(aliases));
+ strncpy(aliases, ucpath, sizeof(aliases) - 1);
alen = strlen(aliases);
#ifndef __riscos__
if (aliases[alen - 1] != '/') {
diff --git a/test/translit.c b/test/translit.c
index 240f5e2..d8252d2 100644
--- a/test/translit.c
+++ b/test/translit.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
assert(ucpath != NULL);
- strncpy(aliases, ucpath, sizeof(aliases));
+ strncpy(aliases, ucpath, sizeof(aliases) - 1);
alen = strlen(aliases);
#ifndef __riscos__
if (aliases[alen - 1] != '/') {