mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 06:00:08 +01:00
ffGetFileContent now uses FFstrbuf for preventing buffer overflows
This commit is contained in:
+4
-5
@@ -20,9 +20,7 @@ void ffPrintTheme(FFinstance* instance)
|
||||
if(gtk4[0] == '\0')
|
||||
strcpy(gtk4, "Adwaita");
|
||||
|
||||
FFstrbuf gtkPretty;
|
||||
ffStrbufInit(>kPretty);
|
||||
|
||||
FF_STRBUF_CREATE(gtkPretty);
|
||||
ffFormatGtkPretty(>kPretty, gtk2, gtk3, gtk4);
|
||||
|
||||
ffPrintLogoAndKey(instance, "Theme");
|
||||
@@ -36,8 +34,7 @@ void ffPrintTheme(FFinstance* instance)
|
||||
}
|
||||
else
|
||||
{
|
||||
FFstrbuf theme;
|
||||
ffStrbufInit(&theme);
|
||||
FF_STRBUF_CREATE(theme);
|
||||
|
||||
ffParseFormatString(&theme, &instance->config.themeFormat, 5,
|
||||
(FFformatarg){FF_FORMAT_ARG_TYPE_STRING, plasma},
|
||||
@@ -48,6 +45,8 @@ void ffPrintTheme(FFinstance* instance)
|
||||
);
|
||||
|
||||
ffStrbufWriteTo(&theme, stdout);
|
||||
|
||||
ffStrbufDestroy(&theme);
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
||||
Reference in New Issue
Block a user