rewrite the emulator to use UTF-8 internally

This commit is contained in:
David Hrdlička
2021-03-14 20:35:01 +01:00
parent 56d62de4fe
commit dfbbe08a07
146 changed files with 1507 additions and 1457 deletions

View File

@@ -267,15 +267,12 @@ net_pcap_prepare(netdev_t *list)
memset(list->device, '\0', sizeof(list->device));
memset(list->description, '\0', sizeof(list->description));
strncpy(list->device, dev->name, 127);
strncpy(list->device, dev->name, sizeof(list->device) - 1);
if (dev->description) {
if (strlen(dev->description) <= 127)
strcpy(list->description, dev->description);
else
strncpy(list->description, dev->description, 127);
strncpy(list->description, dev->description, sizeof(list->description) - 1);
} else {
/* if description is NULL, set the name. This allows pcap to display *something* useful under WINE */
strncpy(list->description, dev->name, sizeof(list->description)-1);
strncpy(list->description, dev->name, sizeof(list->description) - 1);
}
list++; i++;