Revision 363a37d5 vl.c
b/vl.c | ||
---|---|---|
1915 | 1915 |
char cbuf[50] = "\n\r"; |
1916 | 1916 |
|
1917 | 1917 |
if (term_escape_char > 0 && term_escape_char < 26) { |
1918 |
sprintf(cbuf,"\n\r");
|
|
1919 |
sprintf(ebuf,"C-%c", term_escape_char - 1 + 'a');
|
|
1918 |
snprintf(cbuf, sizeof(cbuf), "\n\r");
|
|
1919 |
snprintf(ebuf, sizeof(ebuf), "C-%c", term_escape_char - 1 + 'a');
|
|
1920 | 1920 |
} else { |
1921 |
sprintf(cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r", |
|
1922 |
term_escape_char); |
|
1921 |
snprintf(cbuf, sizeof(cbuf), |
|
1922 |
"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r", |
|
1923 |
term_escape_char); |
|
1923 | 1924 |
} |
1924 | 1925 |
chr->chr_write(chr, (uint8_t *)cbuf, strlen(cbuf)); |
1925 | 1926 |
for (i = 0; mux_help[i] != NULL; i++) { |
... | ... | |
4385 | 4386 |
* Allocate TAP device, returns opened fd. |
4386 | 4387 |
* Stores dev name in the first arg(must be large enough). |
4387 | 4388 |
*/ |
4388 |
int tap_alloc(char *dev) |
|
4389 |
int tap_alloc(char *dev, size_t dev_size)
|
|
4389 | 4390 |
{ |
4390 | 4391 |
int tap_fd, if_fd, ppa = -1; |
4391 | 4392 |
static int ip_fd = 0; |
... | ... | |
4498 | 4499 |
syslog (LOG_ERR, "Can't set multiplexor id"); |
4499 | 4500 |
} |
4500 | 4501 |
|
4501 |
sprintf(dev, "tap%d", ppa);
|
|
4502 |
snprintf(dev, dev_size, "tap%d", ppa);
|
|
4502 | 4503 |
return tap_fd; |
4503 | 4504 |
} |
4504 | 4505 |
|
... | ... | |
4506 | 4507 |
{ |
4507 | 4508 |
char dev[10]=""; |
4508 | 4509 |
int fd; |
4509 |
if( (fd = tap_alloc(dev)) < 0 ){ |
|
4510 |
if( (fd = tap_alloc(dev, sizeof(dev))) < 0 ){
|
|
4510 | 4511 |
fprintf(stderr, "Cannot allocate TAP device\n"); |
4511 | 4512 |
return -1; |
4512 | 4513 |
} |
... | ... | |
5461 | 5462 |
!strcmp(machine->name, "versatileab")) { |
5462 | 5463 |
type = IF_SCSI; |
5463 | 5464 |
max_devs = MAX_SCSI_DEVS; |
5464 |
strcpy(devname, "scsi");
|
|
5465 |
pstrcpy(devname, sizeof(devname), "scsi");
|
|
5465 | 5466 |
} else { |
5466 | 5467 |
type = IF_IDE; |
5467 | 5468 |
max_devs = MAX_IDE_DEVS; |
5468 |
strcpy(devname, "ide");
|
|
5469 |
pstrcpy(devname, sizeof(devname), "ide");
|
|
5469 | 5470 |
} |
5470 | 5471 |
media = MEDIA_DISK; |
5471 | 5472 |
|
Also available in: Unified diff