fix
This commit is contained in:
parent
bbf0fd0aba
commit
b88f882a17
@ -12,8 +12,9 @@
|
||||
#define CLOCK CLOCK_MONOTONIC
|
||||
#endif
|
||||
|
||||
#define OS_SIZE 128
|
||||
typedef struct {
|
||||
char os_name[128];
|
||||
char os_name[OS_SIZE + 1];
|
||||
struct utsname uts;
|
||||
|
||||
char *pkg_cmd;
|
||||
|
@ -64,9 +64,11 @@ char *OpenBSD[] = {
|
||||
};
|
||||
|
||||
char *PlainOs[] = {
|
||||
" /U /U ",
|
||||
"( . .) ",
|
||||
"*(()()) ",
|
||||
" (\\(\\ ",
|
||||
" j . .) ",
|
||||
" | ° ! ",
|
||||
" ? ; ",
|
||||
" c?\".UJ ",
|
||||
" "
|
||||
};
|
||||
|
||||
|
@ -22,9 +22,6 @@ FETCH Init(void) {
|
||||
if (GetOs(fetch.os_name, sizeof(fetch.os_name)))
|
||||
snprintf(fetch.os_name, sizeof(fetch.os_name), "%s", fetch.uts.sysname);
|
||||
|
||||
else
|
||||
snprintf(fetch.os_name, sizeof(fetch.os_name), "%s", fetch.os_name + strlen("NAME=\""));
|
||||
|
||||
fetch.font_color = FONT_COLOR;
|
||||
GetArt(&fetch);
|
||||
return fetch;
|
||||
@ -36,10 +33,11 @@ int GetOs(char *os_name, size_t len) {
|
||||
return 1;
|
||||
|
||||
while (fgets(os_name, len, fp)) {
|
||||
if (!strncmp(os_name, "NAME=", 5)) {
|
||||
if (!strncmp(os_name, "PRETTY_NAME=\"", 5)) {
|
||||
os_name[strlen(os_name) - 2] = '\0';
|
||||
fclose(fp);
|
||||
snprintf(os_name, len, os_name + strlen("PRETTY_NAME=\""));
|
||||
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user