This commit is contained in:
2026-05-11 11:13:54 +02:00
parent c93ae21114
commit c1fd1f706e
11 changed files with 41 additions and 39 deletions

View File

@@ -10,9 +10,9 @@
void sys_get_time(struct time_date_t *td) {
constexpr char months[][4] = {"sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paz", "lis", "gru"};
constexpr char wdays[][4] = {"Nie", "Pon", "Wto", "Sro", "Czw", "Pia", "Sob"};
const time_t t = time(nullptr);
const char months[][4] = {"sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paz", "lis", "gru"};
const char wdays[][4] = {"Nie", "Pon", "Wto", "Sro", "Czw", "Pia", "Sob"};
const time_t t = time(NULL);
const struct tm *tm = localtime(&t);
snprintf(td->time, sizeof(td->time), "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
snprintf(td->date, sizeof(td->date), "%s, %02d %s", wdays[tm->tm_wday], tm->tm_mday, months[tm->tm_mon]);
@@ -27,7 +27,7 @@ void sys_get_ram(struct memory_t *ram) {
memset(ram, 0, sizeof(struct memory_t)); // zero out all values so we dont break out of the loop early
FILE *f = fopen("/proc/meminfo", "r");
if (f == nullptr)
if (f == NULL)
return;
while (fgets(buf, sizeof(buf), f)) {