static void print_log(char *name, int32_t item_price, int16_t einheiten,
char *nickname, char *rest) {
char *time = get_time();
+ char *ptr = NULL;
uint8_t n;
char price[EUR_FORMAT_MINLEN + 1];
if (format_euro(price, sizeof(price), item_price) == NULL) {
exit(1);
}
- /* TODO: teach the EUR sign to the printer.
- * Until then, we just overwrite it with "E" */
- price[EUR_FORMAT_MINLEN - 1] = 'E';
- rest[EUR_FORMAT_MINLEN - 1] = 'E';
-
/* clang-format off */
n = snprintf(print_buffer, sizeof(print_buffer),
/* enable lower case letters -- 1 */
17, status.transaction_id, time, name, price, rest, einheiten,
(*nickname != '\0' ? nickname : "Unbekannt"));
/* clang-format on */
+
+ /* TODO: teach the EUR sign to the printer.
+ * Until then, we just overwrite it with "E" */
+ ptr = print_buffer;
+ while (ptr = strchr(ptr, EURSYM[0])) {
+ *ptr = 'E';
+ }
+
if (n > sizeof(print_buffer)) {
cprintf("\r\nprint_log(): print_buffer overflowed!\r\n"
"Wanted to write %d bytes\r\n%s\r\n",