mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-04 22:24:12 -04:00
Replace most instances of sprintf() with snprintf()
This commit is contained in:
@@ -71,7 +71,7 @@ void RGBController_SRGBmodsPico::SetupZones()
|
||||
for(unsigned int channel_idx = 0; channel_idx < SRGBMODS_PICO_NUM_CHANNELS; channel_idx++)
|
||||
{
|
||||
char ch_idx_string[2];
|
||||
sprintf(ch_idx_string, "%d", channel_idx + 1);
|
||||
snprintf(ch_idx_string, 2, "%d", channel_idx + 1);
|
||||
|
||||
zones[channel_idx].name = "Channel ";
|
||||
zones[channel_idx].name.append(ch_idx_string);
|
||||
@@ -94,7 +94,7 @@ void RGBController_SRGBmodsPico::SetupZones()
|
||||
for(unsigned int led_ch_idx = 0; led_ch_idx < zones[channel_idx].leds_count; led_ch_idx++)
|
||||
{
|
||||
char led_idx_string[4];
|
||||
sprintf(led_idx_string, "%d", led_ch_idx + 1);
|
||||
snprintf(led_idx_string, 4, "%d", led_ch_idx + 1);
|
||||
|
||||
led new_led;
|
||||
new_led.name = "LED ";
|
||||
@@ -149,4 +149,4 @@ void RGBController_SRGBmodsPico::UpdateSingleLED(int led)
|
||||
void RGBController_SRGBmodsPico::DeviceUpdateMode()
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user