Index: uspace/lib/libc/generic/getopt.c
===================================================================
--- uspace/lib/libc/generic/getopt.c	(revision 47a67083af2250b8ad3776688b418510be1e0583)
+++ uspace/lib/libc/generic/getopt.c	(revision 732bb0c5e68395d4846d2c55a85a66056a5cb76e)
@@ -387,6 +387,6 @@
 		for (i = 0; long_options[i].name; i++) {
 			/* find matching long option */
-			if (strncmp(current_argv, long_options[i].name,
-			    current_argv_len))
+			if (str_lcmp(current_argv, long_options[i].name,
+			    str_nlength(current_argv, current_argv_len)))
 				continue;
 
Index: uspace/lib/libc/generic/string.c
===================================================================
--- uspace/lib/libc/generic/string.c	(revision 47a67083af2250b8ad3776688b418510be1e0583)
+++ uspace/lib/libc/generic/string.c	(revision 732bb0c5e68395d4846d2c55a85a66056a5cb76e)
@@ -662,15 +662,4 @@
 }
 
-int strncmp(const char *a, const char *b, size_t n)
-{
-	size_t c = 0;
-
-	while (c < n && a[c] && b[c] && (!(a[c] - b[c])))
-		c++;
-	
-	return ( c < n ? a[c] - b[c] : 0);
-	
-}
-
 int stricmp(const char *a, const char *b)
 {
Index: uspace/lib/libc/include/string.h
===================================================================
--- uspace/lib/libc/include/string.h	(revision 47a67083af2250b8ad3776688b418510be1e0583)
+++ uspace/lib/libc/include/string.h	(revision 732bb0c5e68395d4846d2c55a85a66056a5cb76e)
@@ -87,5 +87,4 @@
  */
 
-extern int strncmp(const char *, const char *, size_t);
 extern int stricmp(const char *, const char *);
 
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 47a67083af2250b8ad3776688b418510be1e0583)
+++ uspace/srv/vfs/vfs_ops.c	(revision 732bb0c5e68395d4846d2c55a85a66056a5cb76e)
@@ -805,15 +805,15 @@
 void vfs_rename(ipc_callid_t rid, ipc_call_t *request)
 {
-	size_t len;
+	size_t olen, nlen;
 	ipc_callid_t callid;
 	int rc;
 
 	/* Retrieve the old path. */
-	if (!ipc_data_write_receive(&callid, &len)) {
+	if (!ipc_data_write_receive(&callid, &olen)) {
 		ipc_answer_0(callid, EINVAL);
 		ipc_answer_0(rid, EINVAL);
 		return;
 	}
-	char *old = malloc(len + 1);
+	char *old = malloc(olen + 1);
 	if (!old) {
 		ipc_answer_0(callid, ENOMEM);
@@ -821,13 +821,13 @@
 		return;
 	}
-	if ((rc = ipc_data_write_finalize(callid, old, len))) {
-		ipc_answer_0(rid, rc);
-		free(old);
-		return;
-	}
-	old[len] = '\0';
+	if ((rc = ipc_data_write_finalize(callid, old, olen))) {
+		ipc_answer_0(rid, rc);
+		free(old);
+		return;
+	}
+	old[olen] = '\0';
 	
 	/* Retrieve the new path. */
-	if (!ipc_data_write_receive(&callid, &len)) {
+	if (!ipc_data_write_receive(&callid, &nlen)) {
 		ipc_answer_0(callid, EINVAL);
 		ipc_answer_0(rid, EINVAL);
@@ -835,5 +835,5 @@
 		return;
 	}
-	char *new = malloc(len + 1);
+	char *new = malloc(nlen + 1);
 	if (!new) {
 		ipc_answer_0(callid, ENOMEM);
@@ -842,5 +842,5 @@
 		return;
 	}
-	if ((rc = ipc_data_write_finalize(callid, new, len))) {
+	if ((rc = ipc_data_write_finalize(callid, new, nlen))) {
 		ipc_answer_0(rid, rc);
 		free(old);
@@ -848,8 +848,8 @@
 		return;
 	}
-	new[len] = '\0';
-
-	char *oldc = canonify(old, &len);
-	char *newc = canonify(new, NULL);
+	new[nlen] = '\0';
+
+	char *oldc = canonify(old, &olen);
+	char *newc = canonify(new, &nlen);
 	if (!oldc || !newc) {
 		ipc_answer_0(rid, EINVAL);
@@ -858,5 +858,7 @@
 		return;
 	}
-	if (!strncmp(newc, oldc, len)) {
+	oldc[olen] = '\0';
+	newc[nlen] = '\0';
+	if (!str_lcmp(newc, oldc, str_length(oldc))) {
 		/* oldc is a prefix of newc */
 		ipc_answer_0(rid, EINVAL);
