Merge "Enable printf format argument checking."

This commit is contained in:
Elliott Hughes 2015-04-09 00:22:36 +00:00 committed by Gerrit Code Review
commit fbde407e4c
4 changed files with 5 additions and 5 deletions

View file

@ -109,7 +109,7 @@ apply_from_adb(RecoveryUI* ui_, bool* wipe_cache, const char* install_file) {
sleep(1); sleep(1);
continue; continue;
} else { } else {
ui->Print("\nTimed out waiting for package.\n\n", strerror(errno)); ui->Print("\nTimed out waiting for package.\n\n");
result = INSTALL_ERROR; result = INSTALL_ERROR;
kill(child, SIGKILL); kill(child, SIGKILL);
break; break;

View file

@ -844,7 +844,7 @@ static int apply_from_sdcard(Device* device, bool* wipe_cache) {
char* path = browse_directory(SDCARD_ROOT, device); char* path = browse_directory(SDCARD_ROOT, device);
if (path == NULL) { if (path == NULL) {
ui->Print("\n-- No package file selected.\n", path); ui->Print("\n-- No package file selected.\n");
return INSTALL_ERROR; return INSTALL_ERROR;
} }

View file

@ -47,11 +47,11 @@ class ScreenRecoveryUI : public RecoveryUI {
bool WasTextEverVisible(); bool WasTextEverVisible();
// printing messages // printing messages
void Print(const char* fmt, ...); // __attribute__((format(printf, 1, 2))); void Print(const char* fmt, ...) __printflike(2, 3);
// menu display // menu display
void StartMenu(const char* const * headers, const char* const * items, void StartMenu(const char* const * headers, const char* const * items,
int initial_selection); int initial_selection);
int SelectMenu(int sel); int SelectMenu(int sel);
void EndMenu(); void EndMenu();

2
ui.h
View file

@ -63,7 +63,7 @@ class RecoveryUI {
// Write a message to the on-screen log (shown if the user has // Write a message to the on-screen log (shown if the user has
// toggled on the text display). // toggled on the text display).
virtual void Print(const char* fmt, ...) = 0; // __attribute__((format(printf, 1, 2))) = 0; virtual void Print(const char* fmt, ...) __printflike(2, 3) = 0;
// --- key handling --- // --- key handling ---