]> git.sur5r.net Git - c128-kasse/blobdiff - src/kasse.c
README: remove emulator configuration, we use -config vicerc
[c128-kasse] / src / kasse.c
index 54521e68d905c266a6a0a039ec69f62959c676c3..c5796f9a580788b6a514b86221511518dfb1375f 100644 (file)
@@ -51,7 +51,7 @@ static void print_screen(void) {
   /* fill whole line with cyan, so color bits are set up for the clock */
   cprintf("%-80s", "C128-Kasse (phil_fry, sECuRE, sur5r, mxf) " GV);
   textcolor(TC_LIGHT_GRAY);
-  cprintf("\r\n\r\n\r\n"
+  cprintf("\r\n\r\n"
           "Ertrag: %s (%ld Artikel); Drucken: %s\r\n",
           profit, items_sold, (printing == 1 ? "ein" : "aus"));
   textcolor(TC_LIGHT_GRAY);
@@ -112,6 +112,7 @@ static void print_screen(void) {
 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) {
@@ -119,11 +120,6 @@ static void print_log(char *name, int32_t item_price, int16_t einheiten,
     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 */
@@ -146,6 +142,14 @@ static void print_log(char *name, int32_t item_price, int16_t einheiten,
         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",