@@ -152,7 +152,7 @@ static char *uuid_le(const char *uu)
static const unsigned char le[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15};
for (i = 0; i < 16; i++) {
- p += sprintf(p, "%.2x", uu[le[i]]);
+ p += sprintf(p, "%.2x", (unsigned char) uu[le[i]]);
switch (i) {
case 3:
case 5:
@@ -36,7 +36,7 @@ static char *uuid_le(const char *uu)
static const unsigned char le[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15};
for (i = 0; i < 16; i++) {
- p += sprintf(p, "%.2x", uu[le[i]]);
+ p += sprintf(p, "%.2x", (unsigned char) uu[le[i]]);
switch (i) {
case 3:
case 5:
@@ -61,7 +61,7 @@ static int uuid_le_cmp(const char *sec_type, const char *uuid2)
3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15};
for (i = 0; i < 16; i++)
- p += sprintf(p, "%.2x", sec_type[le[i]]);
+ p += sprintf(p, "%.2x", (unsigned char) sec_type[le[i]]);
*p = 0;
return strncmp(uuid1, uuid2, 32);
}
The data type of sprintf called in the function uuid_le() is mismatch. Arm64 compiler force it to unsigned char by default, and can work normally. But if someone compile it with the option -fsigned-char, the function can't work correctly. Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com> --- ras-extlog-handler.c | 2 +- ras-non-standard-handler.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)