mirror of
https://github.com/Tha14/toxic.git
synced 2025-12-07 17:06:35 +01:00
allow line_info_add to take formatted strings with variable # of args
This commit is contained in:
@@ -439,12 +439,9 @@ void* thread_poll (void* arg) // TODO: maybe use thread for every input source
|
||||
void print_devices(ToxWindow* self, DeviceType type)
|
||||
{
|
||||
int i = 0;
|
||||
for ( ; i < size[type]; i ++) {
|
||||
char msg[MAX_STR_SIZE];
|
||||
snprintf(msg, sizeof(msg), "%d: %s", i, devices_names[type][i]);
|
||||
line_info_add(self, NULL, NULL, NULL, msg, SYS_MSG, 0, 0);
|
||||
}
|
||||
|
||||
for ( ; i < size[type]; i ++)
|
||||
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%d: %s", i, devices_names[type][i]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user