Bug 204944 - usr/src/sys/boot/uboot/common/main.c:491: bad printf ?
Summary: usr/src/sys/boot/uboot/common/main.c:491: bad printf ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Enji Cooper
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-12-01 19:35 UTC by David Binderman
Modified: 2015-12-16 09:13 UTC (History)
2 users (show)

See Also:
ngie: mfc-stable10?
ngie: mfc-stable9?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.