Fixed some warnings caused by possibly not enough space for sprintf format.

This commit is contained in:
Volker Ruppert 2019-11-08 13:49:48 +00:00
parent 05f80c2c81
commit dbc8f1aa19
5 changed files with 12 additions and 12 deletions

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2018 The Bochs Project
// Copyright (C) 2002-2019 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -3176,7 +3176,7 @@ int bx_write_floppy_options(FILE *fp, int drive)
int bx_write_usb_options(FILE *fp, int maxports, bx_list_c *base)
{
int i;
char tmpname[20], tmpstr[BX_PATHNAME_LEN];
char tmpname[24], tmpstr[BX_PATHNAME_LEN];
fprintf(fp, "usb_%s: enabled=%d", base->get_name(), SIM->get_param_bool("enabled", base)->get());
if (SIM->get_param_bool("enabled", base)->get()) {

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2018 The Bochs Project
// Copyright (C) 2001-2019 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -176,7 +176,7 @@ void bx_hard_drive_c::init(void)
char string[5];
char sbtext[8];
char ata_name[20];
char pname[8];
char pname[10];
bx_list_c *base;
BX_DEBUG(("Init $Id$"));
@ -3323,7 +3323,7 @@ bx_bool bx_hard_drive_c::get_cd_media_status(Bit32u handle)
bx_bool bx_hard_drive_c::set_cd_media_status(Bit32u handle, bx_bool status)
{
char ata_name[20];
char ata_name[22];
if (handle >= BX_MAX_ATA_CHANNEL*2) return 0;

View File

@ -9,7 +9,7 @@
//
// Authors: Beth Kon <bkon@us.ibm.com>
//
// Copyright (C) 2017-2018 The Bochs Project
// Copyright (C) 2017-2019 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -199,14 +199,14 @@ void bx_hpet_c::reset(unsigned type)
void bx_hpet_c::register_state(void)
{
char tnum[10];
char tnum[16];
bx_list_c *tim;
bx_list_c *list = new bx_list_c(SIM->get_bochs_root(), "hpet", "HPET State");
BXRS_HEX_PARAM_FIELD(list, config, s.config);
BXRS_HEX_PARAM_FIELD(list, isr, s.isr);
BXRS_HEX_PARAM_FIELD(list, hpet_counter, s.hpet_counter);
for (int i = 0; i < s.num_timers; i++) {
for (Bit8u i = 0; i < s.num_timers; i++) {
sprintf(tnum, "timer%d", i);
tim = new bx_list_c(list, tnum);
BXRS_HEX_PARAM_FIELD(tim, config, s.timer[i].config);

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004-2017 The Bochs Project
// Copyright (C) 2004-2019 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -620,7 +620,7 @@ int tftp_send_error(Bit8u *buffer, unsigned code, const char *msg, tftp_session_
int tftp_send_data(Bit8u *buffer, unsigned block_nr, tftp_session_t *s)
{
char msg[BX_PATHNAME_LEN];
char msg[BX_PATHNAME_LEN + 16];
int rd;
FILE *fp = fopen(s->filename, "rb");

View File

@ -5,7 +5,7 @@
// USB hub emulation support (ported from QEMU)
//
// Copyright (C) 2005 Fabrice Bellard
// Copyright (C) 2009-2016 The Bochs Project
// Copyright (C) 2009-2019 The Bochs Project
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -273,7 +273,7 @@ usb_hub_device_c::~usb_hub_device_c(void)
void usb_hub_device_c::register_state_specific(bx_list_c *parent)
{
Bit8u i;
char portnum[6];
char portnum[16];
bx_list_c *port, *pconf, *config;
hub.state = new bx_list_c(parent, "hub", "USB HUB Device State");