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

Unified Diff: cgpt/cmd_add.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
Index: cgpt/cmd_add.c
diff --git a/cgpt/cmd_add.c b/cgpt/cmd_add.c
index 21085e71444a8fd896e697791356cf2b21ef7e91..38b7eec6fafcd235267837837e174308f011014a 100644
--- a/cgpt/cmd_add.c
+++ b/cgpt/cmd_add.c
@@ -244,8 +244,10 @@ int cmd_add(int argc, char *argv[]) {
if (set_unique)
memcpy(&entry->unique, &unique_guid, sizeof(Guid));
if (label) {
- UTF8ToUTF16((uint8_t *)label, entry->name,
- sizeof(entry->name) / sizeof(entry->name[0]));
+ if (CGPT_OK != UTF8ToUTF16((uint8_t *)label, entry->name,
+ sizeof(entry->name) / sizeof(entry->name[0]))) {
+ goto bad;
Bill Richardson 2010/11/17 17:41:49 We should print an error message indicating that t
Louis 2010/11/18 05:35:21 Done.
+ }
}
if (set_raw) {
entry->attrs.fields.gpt_att = raw_value;

Powered by Google App Engine
This is Rietveld 408576698