mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Fix incorrect format strings
In many cases format strings in vboot_reference do not match their
parameters, which causes all kind of ugly results when examining debug
output.
Enforce proper format verification.
CQ-DEPEND=CL:65396
BRANCH=pit
BUG=none
TEST=manual
. compiled cleanly in vboot_reference, observed debug printouts
making sense.
Change-Id: I58d5ba1f9097ef9922fbaeb7a9946aadf5eb8617
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65394
This commit is contained in:
committed by
ChromeBot
parent
53710471b5
commit
7aa250f2db
@@ -372,7 +372,8 @@ void VbExError(const char *format, ...);
|
||||
/**
|
||||
* Output a debug message. Supports printf()-style formatting.
|
||||
*/
|
||||
void VbExDebug(const char *format, ...);
|
||||
void VbExDebug(const char *format, ...)
|
||||
__attribute__ ((format (__printf__, 1, 2)));
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Memory (from utility.h) */
|
||||
|
||||
@@ -153,6 +153,6 @@ uint32_t SetTPMBootModeState(int developer_mode, int recovery_mode,
|
||||
result = TlclExtend(BOOT_MODE_PCR, in_digest, out_digest);
|
||||
VBDEBUG(("TPM: SetTPMBootModeState boot mode PCR out_digest "
|
||||
"%02x %02x %02x %02x\n",
|
||||
out_digest, out_digest+1, out_digest+2, out_digest+3));
|
||||
out_digest[0], out_digest[1], out_digest[2], out_digest[3]));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ int VbUserConfirms(VbCommonParams *cparams, int space_means_no)
|
||||
return 1;
|
||||
break;
|
||||
case ' ':
|
||||
VBDEBUG(("%s() - Space (%s)\n", __func__,
|
||||
VBDEBUG(("%s() - Space (%d)\n", __func__,
|
||||
space_means_no));
|
||||
if (space_means_no)
|
||||
return 0;
|
||||
|
||||
@@ -69,7 +69,7 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
|
||||
uint32_t this_msecs, on_msecs, total_msecs;
|
||||
uint32_t count;
|
||||
|
||||
VBDEBUG(("VbGetDevMusicNotes: use_short is %d, hdr is %lx, "
|
||||
VBDEBUG(("VbGetDevMusicNotes: use_short is %d, hdr is %p, "
|
||||
"maxsize is %d\n", use_short, hdr, maxsize));
|
||||
|
||||
if (use_short) {
|
||||
@@ -112,7 +112,8 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
|
||||
if ((sizeof(VbDevMusicNote) > UINT_MAX / hdr->count) ||
|
||||
(sizeof(hdr->count) >
|
||||
UINT_MAX - hdr->count * sizeof(VbDevMusicNote))) {
|
||||
VBDEBUG(("VbGetDevMusicNotes: count=%d, just isn't right\n"));
|
||||
VBDEBUG(("VbGetDevMusicNotes: count=%d, just isn't right\n",
|
||||
hdr->count));
|
||||
goto nope;
|
||||
}
|
||||
|
||||
@@ -127,7 +128,7 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
|
||||
goto nope;
|
||||
}
|
||||
|
||||
VBDEBUG(("VbGetDevMusicNotes: custom notes struct at %lx\n", hdr));
|
||||
VBDEBUG(("VbGetDevMusicNotes: custom notes struct at %p\n", hdr));
|
||||
|
||||
/*
|
||||
* Measure the audible sound up to the first 22 seconds, being careful
|
||||
@@ -148,7 +149,7 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
|
||||
}
|
||||
|
||||
/* We require at least one second of noise in the first 22 seconds */
|
||||
VBDEBUG(("VbGetDevMusicNotes: with %ld msecs of sound to begin\n",
|
||||
VBDEBUG(("VbGetDevMusicNotes: with %d msecs of sound to begin\n",
|
||||
on_msecs));
|
||||
if (on_msecs < REQUIRED_NOISE_TIME)
|
||||
goto nope;
|
||||
@@ -157,7 +158,7 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
|
||||
* We'll also require that the total time be less than a minute. No
|
||||
* real reason, it just gives us less to worry about.
|
||||
*/
|
||||
VBDEBUG(("VbGetDevMusicNotes: lasting %ld msecs\n", total_msecs));
|
||||
VBDEBUG(("VbGetDevMusicNotes: lasting %d msecs\n", total_msecs));
|
||||
if (total_msecs > MAX_CUSTOM_DELAY) {
|
||||
goto nope;
|
||||
}
|
||||
@@ -183,7 +184,7 @@ static void VbGetDevMusicNotes(VbAudioContext *audio, int use_short)
|
||||
notebuf[hdr->count].msec = this_msecs;
|
||||
notebuf[hdr->count].frequency = 0;
|
||||
count++;
|
||||
VBDEBUG(("VbGetDevMusicNotes: adding %ld msecs of silence\n",
|
||||
VBDEBUG(("VbGetDevMusicNotes: adding %d msecs of silence\n",
|
||||
this_msecs));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user