From: Krzysztof Opasiak Date: Wed, 12 Feb 2014 10:34:01 +0000 (+0100) Subject: libusbgx: Update strings only when writting US English strings. X-Git-Tag: libusbgx-v0.1.0~254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=287b62f9246fbdca54d6abfe91b710c7669c4040;p=platform%2Fupstream%2Flibusbg.git libusbgx: Update strings only when writting US English strings. Strings in current verison of library are hardcoded to US English. Functions which set strings are generic and allow to set other languages, but internal library structures should be update only when setting US English strings. Signed-off-by: Krzysztof Opasiak [Port from libusbg and update description] Signed-off-by: Krzysztof Opasiak --- diff --git a/src/usbg.c b/src/usbg.c index 753b930..974077f 100644 --- a/src/usbg.c +++ b/src/usbg.c @@ -617,7 +617,9 @@ void usbg_set_gadget_serial_number(struct gadget *g, int lang, char *serno) mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO); - strcpy(g->strs.str_ser, serno); + /* strings in library are hardcoded to US English for now */ + if (lang == LANG_US_ENG) + strcpy(g->strs.str_ser, serno); usbg_write_string(path, "", "serialnumber", serno); } @@ -630,7 +632,9 @@ void usbg_set_gadget_manufacturer(struct gadget *g, int lang, char *mnf) mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO); - strcpy(g->strs.str_mnf, mnf); + /* strings in library are hardcoded to US English for now */ + if (lang == LANG_US_ENG) + strcpy(g->strs.str_mnf, mnf); usbg_write_string(path, "", "manufacturer", mnf); } @@ -643,7 +647,9 @@ void usbg_set_gadget_product(struct gadget *g, int lang, char *prd) mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO); - strcpy(g->strs.str_prd, prd); + /* strings in library are hardcoded to US English for now */ + if (lang == LANG_US_ENG) + strcpy(g->strs.str_prd, prd); usbg_write_string(path, "", "product", prd); } @@ -758,7 +764,9 @@ void usbg_set_config_string(struct config *c, int lang, char *str) mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO); - strcpy(c->str_cfg, str); + /* strings in library are hardcoded to US English for now */ + if (lang == LANG_US_ENG) + strcpy(c->str_cfg, str); usbg_write_string(path, "", "configuration", str); }