]> git.sur5r.net Git - c128-kasse/blobdiff - time.c
fix printing, nice formatting used
[c128-kasse] / time.c
diff --git a/time.c b/time.c
index 276380b28eac67db7b4677edecff3dd1d3eab4a1..7b9f4cb5279b5ac12467be242a954ef03ef36996 100644 (file)
--- a/time.c
+++ b/time.c
@@ -7,18 +7,14 @@ char *get_time() {
        long int h = PEEK(0x00A0) * 65536,
                m = PEEK(0x00A1) * 256,
                s = PEEK(0x00A2);
-       char *buffer = malloc(9 * sizeof(char));
+       static char buffer[9];
        BYTE hrs, min;
-       if (buffer == NULL) {
-               perror("malloc()");
-               exit(1);
-       }
        h = (h + m + s) / 60;
        hrs = (h / 3600);
        h -= (hrs * 3600);
        min = (h / 60);
        h -= (min * 60);
-//     sprintf(buffer, "%02d:%02d:%02d", hrs, min, (int)h);
+       sprintf(buffer, "%02d:%02d:%02d", hrs, min, (int)h);
        return buffer;
 }