diff options
| author | Anser <rostgans@tutamail.com> | 2026-08-11 13:11:39 +0200 |
|---|---|---|
| committer | Anser <rostgans@tutamail.com> | 2026-08-11 20:04:21 +0200 |
| commit | 729746e50ebc8e4eb4c98f7556a241aec111e07d (patch) | |
| tree | e33e627474fdba4c625bb72f9848b1f067303aff /src/cpu.c | |
| parent | eb6f986361713d6ce47c6d4572bb24d9f6207ddf (diff) | |
some more rework in readme.md and src file structure
Diffstat (limited to 'src/cpu.c')
| -rw-r--r-- | src/cpu.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/cpu.c b/src/cpu.c deleted file mode 100644 index c45cd9e..0000000 --- a/src/cpu.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "../include/cfetch.h" - -void get_cpu(system_info_t *info) { - FILE* file = fopen("/proc/cpuinfo", "r"); - - //check file existence - if (!file) { - perror("/proc/cpuinfo not found"); - return; - } - - char line[256]; - char *model_name = NULL; - - //read per line - while (fgets(line, sizeof(line), file)) { - char* p = strstr(line, "model name"); - - if (p != NULL) { - model_name = strchr(p, ':') + 1; //skip : - break; - } - } - - if (model_name != NULL) { - char *string = string_format(model_name); - - if (string == NULL) { - printf("CPU: Error string not found.\n"); - free(string); - model_name = NULL; - } else { - printf("CPU: %s\n", string); - free(string); - model_name = NULL; - } - - } else { - printf("CPU: Error model_name not found.\n"); - } - - fclose(file); - return; -} |
