ffGetFileContent now uses FFstrbuf for preventing buffer overflows

This commit is contained in:
Linus Dierheimer
2021-03-21 16:52:17 +01:00
parent 0d3500c66f
commit 101d19a015
24 changed files with 144 additions and 123 deletions
+4 -5
View File
@@ -20,9 +20,7 @@ void ffPrintTheme(FFinstance* instance)
if(gtk4[0] == '\0')
strcpy(gtk4, "Adwaita");
FFstrbuf gtkPretty;
ffStrbufInit(&gtkPretty);
FF_STRBUF_CREATE(gtkPretty);
ffFormatGtkPretty(&gtkPretty, 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');