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

Unified Diff: cgpt/cmd_find.c

Issue 5025003: The right implementation of CGPT label conversion between UTF8 and UTF16. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: 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
« cgpt/cmd_add.c ('K') | « 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 e8fe9b319aeee041093c7acae283f58d07928449..c19803baac5eead22457a16c997f41a506b5ed01 100644
--- a/cgpt/cmd_find.c
+++ b/cgpt/cmd_find.c
@@ -181,8 +181,11 @@ 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]),
Bill Richardson 2010/11/17 17:26:39 Should emit an error message here to indicate that
Louis 2010/11/18 05:35:21 Done.
+ (uint8_t *)partlabel, sizeof(partlabel))) {
+ return 0;
+ }
if (!strncmp(label, partlabel, sizeof(partlabel))) {
found = 1;
}
« cgpt/cmd_add.c ('K') | « cgpt/cmd_add.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698