1
0
Fork 0

Make valgrind happy and set a few strings to zero.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2666
This commit is contained in:
Peter Veenstra 2006-06-30 20:04:21 +00:00
parent 43d7055361
commit 49eea1af58
3 changed files with 10 additions and 10 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_files.cpp,v 1.75 2006-06-22 13:15:07 qbix79 Exp $ */
/* $Id: dos_files.cpp,v 1.76 2006-06-30 20:04:21 qbix79 Exp $ */
#include <string.h>
#include <stdlib.h>
@ -655,10 +655,10 @@ static bool isvalid(const char in){
Bit8u FCB_Parsename(Bit16u seg,Bit16u offset,Bit8u parser ,char *string, Bit8u *change) {
char * string_begin=string;Bit8u ret=0;
DOS_FCB fcb(seg,offset);
bool hasdrive,hasname,hasext;
hasdrive=hasname=hasext=false;
Bitu index;bool finished;Bit8u fill;
DOS_FCB fcb(seg,offset);
bool hasdrive,hasname,hasext,finished;
hasdrive=hasname=hasext=finished=false;
Bitu index=0;Bit8u fill=' ';
/* First get the old data from the fcb */
#ifdef _MSC_VER
#pragma pack (1)

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell.cpp,v 1.74 2006-05-25 15:08:40 qbix79 Exp $ */
/* $Id: shell.cpp,v 1.75 2006-06-30 20:04:21 qbix79 Exp $ */
#include <stdlib.h>
#include <stdarg.h>
@ -263,7 +263,7 @@ void DOS_Shell::ParseLine(char * line) {
void DOS_Shell::RunInternal(void)
{
char input_line[CMD_MAXLINE];
char input_line[CMD_MAXLINE] = {0};
std::string line;
while(bf && bf->ReadLine(input_line))
{
@ -281,7 +281,7 @@ void DOS_Shell::RunInternal(void)
void DOS_Shell::Run(void) {
char input_line[CMD_MAXLINE];
char input_line[CMD_MAXLINE] = {0};
std::string line;
if (cmd->FindStringRemain("/C",line)) {
strcpy(input_line,line.c_str());

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell_batch.cpp,v 1.21 2006-05-25 15:08:40 qbix79 Exp $ */
/* $Id: shell_batch.cpp,v 1.22 2006-06-30 20:04:21 qbix79 Exp $ */
#include <stdlib.h>
#include <string.h>
@ -43,7 +43,7 @@ BatchFile::~BatchFile() {
}
bool BatchFile::ReadLine(char * line) {
Bit8u c;Bit16u n;
Bit8u c=0;Bit16u n=1;
char temp[CMD_MAXLINE];
emptyline:
char * cmd_write=temp;