Having a first stab at flawfinder errors

This commit is contained in:
Thomas Göttgens
2023-01-16 10:55:40 +01:00
parent 5520d68b34
commit aca1241a7f
11 changed files with 41 additions and 41 deletions
+3 -3
View File
@@ -110,12 +110,12 @@ const char *getDeviceName()
// Meshtastic_ab3c or Shortname_abcd
static char name[20];
sprintf(name, "%02x%02x", dmac[4], dmac[5]);
snprintf(name, sizeof(name), "%02x%02x", dmac[4], dmac[5]);
// if the shortname exists and is NOT the new default of ab3c, use it for BLE name.
if ((owner.short_name != NULL) && (strcmp(owner.short_name, name) != 0)) {
sprintf(name, "%s_%02x%02x", owner.short_name, dmac[4], dmac[5]);
snprintf(name, sizeof(name), "%s_%02x%02x", owner.short_name, dmac[4], dmac[5]);
} else {
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
snprintf(name, sizeof(name), "Meshtastic_%02x%02x", dmac[4], dmac[5]);
}
return name;
}