Index: src/io/sink_apple_audio.c
===================================================================
--- src/io/sink_apple_audio.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/sink_apple_audio.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -68,6 +68,6 @@
   }
   if (s->path != NULL) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(uri, PATH_MAX));
-  strncpy(s->path, uri, strnlen(uri, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(uri, PATH_MAX) + 1);
+  strncpy(s->path, uri, strnlen(uri, PATH_MAX) + 1);
 
   s->samplerate = 0;
Index: src/io/sink_sndfile.c
===================================================================
--- src/io/sink_sndfile.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/sink_sndfile.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -64,6 +64,6 @@
 
   if (s->path) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
-  strncpy(s->path, path, strnlen(path, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
+  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
 
   s->samplerate = 0;
Index: src/io/sink_wavwrite.c
===================================================================
--- src/io/sink_wavwrite.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/sink_wavwrite.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -91,6 +91,6 @@
 
   if (s->path) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
-  strncpy(s->path, path, strnlen(path, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
+  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
 
   s->max_size = MAX_SIZE;
Index: src/io/source_apple_audio.c
===================================================================
--- src/io/source_apple_audio.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/source_apple_audio.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -97,6 +97,6 @@
 
   if (s->path) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
-  strncpy(s->path, path, strnlen(path, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
+  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
 
   // open the resource url
Index: src/io/source_avcodec.c
===================================================================
--- src/io/source_avcodec.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/source_avcodec.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -87,6 +87,6 @@
 
   if (s->path) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
-  strncpy(s->path, path, strnlen(path, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
+  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
 
   // register all formats and codecs
Index: src/io/source_sndfile.c
===================================================================
--- src/io/source_sndfile.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/source_sndfile.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -89,6 +89,6 @@
 
   if (s->path) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
-  strncpy(s->path, path, strnlen(path, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
+  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
 
   // try opening the file, getting the info in sfinfo
Index: src/io/source_wavread.c
===================================================================
--- src/io/source_wavread.c	(revision 26a6af7d29e6ec29f66e076b3a26157c2415c8d2)
+++ src/io/source_wavread.c	(revision d2be104ba64fa3254587479bcde2ba8bcacfdb8d)
@@ -88,6 +88,6 @@
 
   if (s->path) AUBIO_FREE(s->path);
-  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
-  strncpy(s->path, path, strnlen(path, PATH_MAX));
+  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
+  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
 
   s->samplerate = samplerate;
