From f8bbc2b54d440789a6a37cce8ada565465710576 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 11 Nov 2013 12:54:53 +0000 Subject: [PATCH] Strip of leading zeroes from the IP. Thanks Zorix Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3843 --- src/hardware/serialport/softmodem.cpp | 30 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/hardware/serialport/softmodem.cpp b/src/hardware/serialport/softmodem.cpp index 10f0dac8..a22e03de 100644 --- a/src/hardware/serialport/softmodem.cpp +++ b/src/hardware/serialport/softmodem.cpp @@ -362,18 +362,23 @@ void CSerialModem::DoCommand() { helper[0]=0; helper--; } + + //Large enough scope, so the buffers are still valid when reaching Dail. + char buffer[128]; + char obuffer[128]; if (strlen(foundstr) >= 12) { // Check if supplied parameter only consists of digits bool isNum = true; - for (Bitu i=0; i '9') isNum = false; if (isNum) { // Parameter is a number with at least 12 digits => this cannot // be a valid IP/name // Transform by adding dots - char buffer[128]; - Bitu j = 0; - for (Bitu i=0; i