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

Unified Diff: cgpt/cmd_find.c

Issue 5104009: Fix to initialize the code point. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: Fix according to code review. Created 10 years, 1 month 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 | « cgpt/cmd_add.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cgpt/cmd_find.c
diff --git a/cgpt/cmd_find.c b/cgpt/cmd_find.c
index 40f10ba0afad567b6b39e8af8253fb7e6e82e9d0..055777e3410748b72a7b01e683243b42fed17ccf 100644
--- a/cgpt/cmd_find.c
+++ b/cgpt/cmd_find.c
@@ -181,8 +181,12 @@ static int do_search(char *filename) {
(set_type && !memcmp(&type_guid, &entry->type, sizeof(Guid)))) {
found = 1;
} else if (set_label) {
- UTF16ToUTF8(entry->name, sizeof(entry->name) / sizeof(entry->name[0]),
- (uint8_t *)partlabel, sizeof(partlabel));
+ if (CGPT_OK != UTF16ToUTF8(entry->name,
+ sizeof(entry->name) / sizeof(entry->name[0]),
+ (uint8_t *)partlabel, sizeof(partlabel))) {
+ Error("The label cannot be converted from UTF16, so abort.\n");
+ return 0;
+ }
if (!strncmp(label, partlabel, sizeof(partlabel))) {
found = 1;
}
« no previous file with comments | « cgpt/cmd_add.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698