diff --git a/src/ucore_bcd.c b/src/ucore_bcd.c index 3dd978c..cfdf373 100644 --- a/src/ucore_bcd.c +++ b/src/ucore_bcd.c @@ -42,10 +42,8 @@ uc_bcd2ascii(const unsigned char *bcd, size_t bcdlen, char *asciiout) size_t idx = 0; for (i = 0; i < bcdlen; i++) { - asciiout[idx] = hex[bcd[i] & 0xf]; - idx++; - asciiout[idx] = hex[(bcd[i] & 0xf0) >> 4]; - idx++; + asciiout[idx++] = hex[bcd[i] & 0xf]; + asciiout[idx++] = hex[(bcd[i] & 0xf0) >> 4]; } asciiout[idx] = 0;