Commit c9792720 authored by claes's avatar claes

String length was to short

parent 7326a1da
/* /*
* Proview $Id: sev_dbms.cpp,v 1.3 2008-09-18 14:37:43 claes Exp $ * Proview $Id: sev_dbms.cpp,v 1.4 2008-11-10 07:57:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -67,7 +67,7 @@ void sev_dbms_env::host(const char *host) ...@@ -67,7 +67,7 @@ void sev_dbms_env::host(const char *host)
if (!host) if (!host)
return; return;
m_host = (char *)realloc(m_host, strlen(host)); m_host = (char *)realloc(m_host, strlen(host)+1);
strcpy(m_host, host); strcpy(m_host, host);
} }
...@@ -76,7 +76,7 @@ void sev_dbms_env::user(const char *user) ...@@ -76,7 +76,7 @@ void sev_dbms_env::user(const char *user)
if (!user) if (!user)
return; return;
m_user = (char *)realloc(m_user, strlen(user)); m_user = (char *)realloc(m_user, strlen(user)+1);
strcpy(m_user, user); strcpy(m_user, user);
} }
...@@ -94,7 +94,7 @@ void sev_dbms_env::dbName(const char *dbName) ...@@ -94,7 +94,7 @@ void sev_dbms_env::dbName(const char *dbName)
if (!dbName) if (!dbName)
return; return;
m_dbName = (char *)realloc(m_dbName, strlen(dbName)); m_dbName = (char *)realloc(m_dbName, strlen(dbName)+1);
strcpy(m_dbName, dbName); strcpy(m_dbName, dbName);
} }
...@@ -103,7 +103,7 @@ void sev_dbms_env::fileName(const char *fileName) ...@@ -103,7 +103,7 @@ void sev_dbms_env::fileName(const char *fileName)
if (!fileName) if (!fileName)
return; return;
m_fileName = (char *)realloc(m_fileName, strlen(fileName)); m_fileName = (char *)realloc(m_fileName, strlen(fileName)+1);
strcpy(m_fileName, fileName); strcpy(m_fileName, fileName);
} }
...@@ -144,7 +144,7 @@ void sev_dbms_env::socket(const char *socket) ...@@ -144,7 +144,7 @@ void sev_dbms_env::socket(const char *socket)
if (!socket) if (!socket)
return; return;
m_socket = (char *)realloc(m_socket, strlen(socket)); m_socket = (char *)realloc(m_socket, strlen(socket)+1);
strcpy(m_socket, socket); strcpy(m_socket, socket);
} }
...@@ -398,7 +398,7 @@ int sev_dbms_env::open(void) ...@@ -398,7 +398,7 @@ int sev_dbms_env::open(void)
int sev_dbms_env::get_systemname() int sev_dbms_env::get_systemname()
{ {
FILE *file; FILE *file;
char fname[120]; pwr_tFileName fname;
char nodename[40]; char nodename[40];
char *bus_str; char *bus_str;
int bus; int bus;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment