initcalls: Fix m68k build and possible buffer overflow

This patch fixes a build bug on m68k - gcc decides to emit a call to the
strlen library function, which we don't implement.

More importantly - my previous patch "init: don't lose initcall return
values" (commit e662e1cfd434aa234b72fbc781f1d70211cb785b) had introduced
potential buffer overflow by wrong calculation of string accumulator
size.

Use strlcat() instead, fixing both bugs.

Many thanks Andreas Schwab and Geert Uytterhoeven for helping
to catch and fix the bug.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Cyrill Gorcunov and committed by Linus Torvalds a76bfd0d e0df154f

+3 -3
+3 -3
init/main.c
··· 697 697 { 698 698 int count = preempt_count(); 699 699 ktime_t t0, t1, delta; 700 - char msgbuf[40]; 700 + char msgbuf[64]; 701 701 int result; 702 702 703 703 if (initcall_debug) { ··· 722 722 sprintf(msgbuf, "error code %d ", result); 723 723 724 724 if (preempt_count() != count) { 725 - strncat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 725 + strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 726 726 preempt_count() = count; 727 727 } 728 728 if (irqs_disabled()) { 729 - strncat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); 729 + strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); 730 730 local_irq_enable(); 731 731 } 732 732 if (msgbuf[0]) {