Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 13f2461548be9766ca2b1b38b05f43028fd2a58f)
+++ uspace/lib/c/generic/assert.c	(revision e06e27166f1b30422fc5f34049108ea34cdd2cfb)
@@ -37,4 +37,5 @@
 #include <atomic.h>
 #include <stacktrace.h>
+#include <stdint.h>
 
 #define MSG_START	"Assertion failed ("
@@ -45,6 +46,18 @@
 static atomic_t failed_asserts;
 
-void assert_abort(const char *cond, const char *file, const char *line)
+void assert_abort(const char *cond, const char *file, unsigned int line)
 {
+	char lstr[11];
+	char *pd = &lstr[10];
+	uint32_t ln = (uint32_t) line;
+
+	/*
+	 * Convert ln to a zero-terminated string.
+	 */
+	*pd-- = 0;
+	for (; ln; ln /= 10)
+		*pd-- = '0' + ln % 10;
+	pd++;
+
 	/*
 	 * Send the message safely to klog. Nested asserts should not occur.
@@ -55,5 +68,5 @@
 	klog_write(file, str_size(file));
 	klog_write(MSG_LINE, str_size(MSG_LINE));
-	klog_write(line, str_size(line));
+	klog_write(pd, str_size(pd));
 	klog_write(MSG_END, str_size(MSG_END));
 
@@ -69,5 +82,5 @@
 	 * assertions.
 	 */
-	printf(MSG_START "%s" MSG_FILE "%s" MSG_LINE "%s" MSG_END,
+	printf(MSG_START "%s" MSG_FILE "%s" MSG_LINE "%" PRIu32 MSG_END,
 	    cond, file, line);
 	stacktrace_print();
Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 13f2461548be9766ca2b1b38b05f43028fd2a58f)
+++ uspace/lib/c/generic/malloc.c	(revision e06e27166f1b30422fc5f34049108ea34cdd2cfb)
@@ -194,5 +194,5 @@
 		if (!(expr)) {\
 			futex_up(&malloc_futex); \
-			assert_abort(#expr, __FILE__, STR2(__LINE__)); \
+			assert_abort(#expr, __FILE__, __LINE__); \
 		} \
 	} while (0)
Index: uspace/lib/c/include/assert.h
===================================================================
--- uspace/lib/c/include/assert.h	(revision 13f2461548be9766ca2b1b38b05f43028fd2a58f)
+++ uspace/lib/c/include/assert.h	(revision e06e27166f1b30422fc5f34049108ea34cdd2cfb)
@@ -47,7 +47,4 @@
  */
 
-#define STR(l)	#l
-#define STR2(l)	STR(l)
-
 #ifndef NDEBUG
 
@@ -55,5 +52,5 @@
 	do { \
 		if (!(expr)) \
-			assert_abort(#expr, __FILE__, STR2(__LINE__)); \
+			assert_abort(#expr, __FILE__, __LINE__); \
 	} while (0)
 
@@ -64,5 +61,5 @@
 #endif /* NDEBUG */
 
-extern void assert_abort(const char *, const char *, const char *)
+extern void assert_abort(const char *, const char *, unsigned int)
     __attribute__((noreturn));
 
