Index: kernel/genarch/src/multiboot/multiboot.c
===================================================================
--- kernel/genarch/src/multiboot/multiboot.c	(revision 06b785f8cd841eaeec20587b753477850c12723b)
+++ kernel/genarch/src/multiboot/multiboot.c	(revision b60c582d0cf4f0476a720c8e05bd742fbffc87ce)
@@ -42,16 +42,13 @@
 /** Extract command name from the multiboot module command line.
  *
- * @param buf      Destination buffer (will always null-terminate).
- * @param n        Size of destination buffer.
+ * @param buf      Destination buffer (will always NULL-terminate).
+ * @param sz       Size of destination buffer (in bytes).
  * @param cmd_line Input string (the command line).
  *
  */
-static void extract_command(char *buf, size_t n, const char *cmd_line)
+static void extract_command(char *buf, size_t sz, const char *cmd_line)
 {
-	const char *start, *end, *cp;
-	size_t max_len;
-	
 	/* Find the first space. */
-	end = strchr(cmd_line, ' ');
+	const char *end = str_chr(cmd_line, ' ');
 	if (end == NULL)
 		end = cmd_line + str_size(cmd_line);
@@ -61,6 +58,7 @@
 	 * next character. Otherwise, place start at beginning of buffer.
 	 */
-	cp = end;
-	start = buf;
+	const char *cp = end;
+	const char *start = buf;
+	
 	while (cp != start) {
 		if (*cp == '/') {
@@ -68,11 +66,9 @@
 			break;
 		}
-		--cp;
+		cp--;
 	}
 	
-	/* Copy the command and null-terminate the string. */
-	max_len = min(n - 1, (size_t) (end - start));
-	strncpy(buf, start, max_len + 1);
-	buf[max_len] = '\0';
+	/* Copy the command. */
+	str_ncpy(buf, start, min(sz, (size_t) (end - start) + 1));
 }
 
@@ -88,6 +84,4 @@
 {
 	uint32_t flags;
-	multiboot_mod_t *mods;
-	uint32_t i;
 	
 	if (signature == MULTIBOOT_LOADER_MAGIC)
@@ -99,8 +93,9 @@
 	
 	/* Copy module information. */
-	
+	uint32_t i;
 	if ((flags & MBINFO_FLAGS_MODS) != 0) {
 		init.cnt = min(mi->mods_count, CONFIG_INIT_TASKS);
-		mods = (multiboot_mod_t *) MULTIBOOT_PTR(mi->mods_addr);
+		multiboot_mod_t *mods
+		    = (multiboot_mod_t *) MULTIBOOT_PTR(mi->mods_addr);
 		
 		for (i = 0; i < init.cnt; i++) {
@@ -114,5 +109,5 @@
 				    MULTIBOOT_PTR(mods[i].string));
 			} else
-				init.tasks[i].name[0] = '\0';
+				init.tasks[i].name[0] = 0;
 		}
 	} else
@@ -121,11 +116,7 @@
 	/* Copy memory map. */
 	
-	int32_t mmap_length;
-	multiboot_mmap_t *mme;
-	uint32_t size;
-	
 	if ((flags & MBINFO_FLAGS_MMAP) != 0) {
-		mmap_length = mi->mmap_length;
-		mme = MULTIBOOT_PTR(mi->mmap_addr);
+		int32_t mmap_length = mi->mmap_length;
+		multiboot_mmap_t *mme = MULTIBOOT_PTR(mi->mmap_addr);
 		e820counter = 0;
 		
@@ -135,5 +126,5 @@
 			
 			/* Compute address of next structure. */
-			size = sizeof(mme->size) + mme->size;
+			uint32_t size = sizeof(mme->size) + mme->size;
 			mme = ((void *) mme) + size;
 			mmap_length -= size;
