Bug 204944

Summary: usr/src/sys/boot/uboot/common/main.c:491: bad printf ?
Product: Base System Reporter: David Binderman <dcb314>
Component: binAssignee: Enji Cooper <ngie>
Status: Closed FIXED    
Severity: Affects Some People CC: ian, ngie
Priority: --- Keywords: patch
Version: CURRENTFlags: ngie: mfc-stable10?
ngie: mfc-stable9?
Hardware: Any   
OS: Any   

Description David Binderman 2015-12-01 19:35:21 UTC
[usr/src/sys/boot/uboot/common/main.c:491]: (error) printf format string requires 2 parameters but only 1 is given.

Source code is

   printf("Booting from %s %\n", ldev);
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2015-12-01 19:40:38 UTC
Yeah, the "% " looks incorrect... Was the % intentional, i.e. should it be deleted, or escaped, i.e. %%?

$ svn diff sys/boot/uboot/common/main.c 
Index: sys/boot/uboot/common/main.c
===================================================================
--- sys/boot/uboot/common/main.c        (revision 291608)
+++ sys/boot/uboot/common/main.c        (working copy)
@@ -488,7 +488,7 @@
        ldev = uboot_fmtdev(&currdev);
        env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset);
        env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset);
-       printf("Booting from %s %\n", ldev);
+       printf("Booting from %s\n", ldev);
 
        setenv("LINES", "24", 1);               /* optional */
        setenv("prompt", "loader>", 1);
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-12-05 23:59:59 UTC
A commit references this bug:

Author: ngie
Date: Sat Dec  5 23:59:30 UTC 2015
New revision: 291876
URL: https://svnweb.freebsd.org/changeset/base/291876

Log:
  Remove stray unescaped `%` in `Booting from ...` informational message

  PR: 204944
  MFC after: 1 week
  X-MFC with: r291164
  Reported by: David Binderman <dcb314@hotmail.com>
  Sponsored by: EMC / Isilon Storage Division

Changes:
  head/sys/boot/uboot/common/main.c
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2015-12-16 09:13:41 UTC
Closing the PR as the code hasn't been MFCed to stable/10.