Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Minor fix in sys command String works with printf %s, but actually it's a UB.

Oleg Kalachev835b2243e8ec
diff --git a/flix/cli.ino b/flix/cli.ino
index a6dec83..de6c60c 100644
--- a/flix/cli.ino
+++ b/flix/cli.ino
@@ -178,7 +178,7 @@ void doCommand(String str, bool echo = false) {
String core = systemState[i].xCoreID == tskNO_AFFINITY ? "*" : String(systemState[i].xCoreID);
int cpuPercentage = systemState[i].ulRunTimeCounter / (totalRunTime / 100);
print("%-5d%-20s%-7d%-6d%-6s%d\n",systemState[i].xTaskNumber, systemState[i].pcTaskName,
- systemState[i].usStackHighWaterMark, systemState[i].uxCurrentPriority, core, cpuPercentage);
+ systemState[i].usStackHighWaterMark, systemState[i].uxCurrentPriority, core.c_str(), cpuPercentage);
}
delete[] systemState;
#endif