use correct datatype with scanf
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4080
This commit is contained in:
parent
ae683cd794
commit
aa7e86c5e5
1 changed files with 5 additions and 3 deletions
|
@ -1130,7 +1130,7 @@ CSerial::CSerial(Bitu id, CommandLine* cmd) {
|
|||
txOverrunErrors=0;
|
||||
overrunIF0=0;
|
||||
breakErrors=0;
|
||||
|
||||
|
||||
for (Bitu i = 0; i <= 7; i++) {
|
||||
WriteHandler[i].Install (i + base, SERIAL_Write, IO_MB);
|
||||
ReadHandler[i].Install (i + base, SERIAL_Read, IO_MB);
|
||||
|
@ -1140,8 +1140,10 @@ CSerial::CSerial(Bitu id, CommandLine* cmd) {
|
|||
bool CSerial::getBituSubstring(const char* name,Bitu* data, CommandLine* cmd) {
|
||||
std::string tmpstring;
|
||||
if(!(cmd->FindStringBegin(name,tmpstring,false))) return false;
|
||||
const char* tmpchar=tmpstring.c_str();
|
||||
if(sscanf(tmpchar,"%u",data)!=1) return false;
|
||||
const char* tmpchar = tmpstring.c_str();
|
||||
unsigned int d = 0;
|
||||
if(sscanf(tmpchar,"%u",&d) != 1) return false;
|
||||
*data = static_cast<Bitu>(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue