Index: kernel/generic/src/lib/string.c
===================================================================
--- kernel/generic/src/lib/string.c	(revision c822026c1caa1849e2dc6fdf00e865eb4b1ff15c)
+++ kernel/generic/src/lib/string.c	(revision 104718520728e9fcc2d1ac1b12bacf1dc07dd8f9)
@@ -109,4 +109,5 @@
 #include <errno.h>
 #include <align.h>
+#include <debug.h>
 
 /** Byte mask consisting of lowest @n bits (out of 8) */
@@ -537,5 +538,5 @@
  *
  * @param dst   Destination buffer.
- * @param count Size of the destination buffer.
+ * @param count Size of the destination buffer (must be > 0).
  * @param src   Source string.
  */
@@ -546,7 +547,6 @@
 	size_t dest_off;
 
-	/* No space for the NULL-terminator in the buffer. */
-	if (size == 0)
-		return;
+	/* There must be space for a null terminator in the buffer. */
+	ASSERT(size > 0);
 	
 	src_off = 0;
@@ -563,8 +563,8 @@
 /** Copy size-limited substring.
  *
- * Copy source string @a src to destination buffer @a dest.
- * No more than @a size bytes are written. If the size of the output buffer
- * is at least one byte, the output string will always be well-formed, i.e.
- * null-terminated and containing only complete characters.
+ * Copy prefix of string @a src of max. size @a size to destination buffer
+ * @a dest. No more than @a size bytes are written. The output string will
+ * always be well-formed, i.e. null-terminated and containing only complete
+ * characters.
  *
  * No more than @a n bytes are read from the input string, so it does not
@@ -572,6 +572,7 @@
  *
  * @param dst   Destination buffer.
- * @param count Size of the destination buffer.
+ * @param count Size of the destination buffer (must be > 0).
  * @param src   Source string.
+ * @param n	Maximum number of bytes to read from @a src.
  */
 void str_ncpy(char *dest, size_t size, const char *src, size_t n)
@@ -581,7 +582,6 @@
 	size_t dest_off;
 
-	/* No space for the null terminator in the buffer. */
-	if (size == 0)
-		return;
+	/* There must be space for a null terminator in the buffer. */
+	ASSERT(size > 0);
 	
 	src_off = 0;
