mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-02 03:14:15 +01:00
Global: use FF_LIST_AUTO_DESTROY
This commit is contained in:
@@ -76,8 +76,7 @@ static void printBattery(FFBatteryOptions* options, BatteryResult* result, uint8
|
||||
|
||||
void ffPrintBattery(FFBatteryOptions* options)
|
||||
{
|
||||
FFlist results;
|
||||
ffListInitA(&results, sizeof(BatteryResult), 0);
|
||||
FF_LIST_AUTO_DESTROY results = ffListCreate(sizeof(BatteryResult));
|
||||
|
||||
const char* error = ffDetectBattery(options, &results);
|
||||
|
||||
@@ -100,8 +99,6 @@ void ffPrintBattery(FFBatteryOptions* options)
|
||||
if(results.length == 0)
|
||||
ffPrintError(FF_BATTERY_MODULE_NAME, 0, &options->moduleArgs, "No batteries found");
|
||||
}
|
||||
|
||||
ffListDestroy(&results);
|
||||
}
|
||||
|
||||
void ffInitBatteryOptions(FFBatteryOptions* options)
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
void ffPrintPowerAdapter(FFPowerAdapterOptions* options)
|
||||
{
|
||||
FFlist results;
|
||||
ffListInit(&results, sizeof(PowerAdapterResult));
|
||||
FF_LIST_AUTO_DESTROY results = ffListCreate(sizeof(PowerAdapterResult));
|
||||
|
||||
const char* error = ffDetectPowerAdapterImpl(&results);
|
||||
|
||||
@@ -59,8 +58,6 @@ void ffPrintPowerAdapter(FFPowerAdapterOptions* options)
|
||||
ffStrbufDestroy(&result->name);
|
||||
}
|
||||
}
|
||||
|
||||
ffListDestroy(&results);
|
||||
}
|
||||
|
||||
void ffInitPowerAdapterOptions(FFPowerAdapterOptions* options)
|
||||
|
||||
Reference in New Issue
Block a user