Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Unified Diff: src/platform/vboot_reference/utils/firmware_utility.cc

Issue 661221: Use uint16_max. (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/vboot_reference/utils/Makefile ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/utils/firmware_utility.cc
diff --git a/src/platform/vboot_reference/utils/firmware_utility.cc b/src/platform/vboot_reference/utils/firmware_utility.cc
index fa207fb34bdd394242f08d52f46a5710ca1821c8..a25be2f1fc9a4349ff102e8bb72240a861be4b94 100644
--- a/src/platform/vboot_reference/utils/firmware_utility.cc
+++ b/src/platform/vboot_reference/utils/firmware_utility.cc
@@ -9,8 +9,9 @@
#include <errno.h>
#include <getopt.h>
-#include <unistd.h>
+#include <stdint.h> // Needed for UINT16_MAX.
#include <stdlib.h>
+#include <unistd.h>
#include <iostream>
@@ -252,7 +253,7 @@ bool FirmwareUtility::CheckOptions(void) {
cerr << "No root key file specified." << "\n";
return false;
}
- if (firmware_version_ <= 0 || firmware_version_ > 0xFFFF) {
+ if (firmware_version_ <= 0 || firmware_version_ > UINT16_MAX) {
cerr << "Invalid or no firmware version specified." << "\n";
return false;
}
@@ -264,7 +265,7 @@ bool FirmwareUtility::CheckOptions(void) {
cerr << "No pre-processed public signing key file specified." << "\n";
return false;
}
- if (key_version_ <= 0 || key_version_ > 0xFFFF) {
+ if (key_version_ <= 0 || key_version_ > UINT16_MAX) {
cerr << "Invalid or no key version specified." << "\n";
return false;
}
« no previous file with comments | « src/platform/vboot_reference/utils/Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698