c99 now
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user