Skip to content

Commit

Permalink
Changed lpszDefault to empty string. According to the ODBC specificat…
Browse files Browse the repository at this point in the history
…in this argument cannot be NULL.
  • Loading branch information
9EOR9 committed Feb 12, 2015
1 parent db41617 commit 0cfdfd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ma_dsn.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ my_bool MADB_ReadDSN(MADB_Dsn *Dsn, char *KeyValue, my_bool OverWrite)
{
char *Value;
/* if no key/value pair was specified, we will try to read Dsn->DSNName */

if (!KeyValue)
{
if (!Dsn->DSNName)
Expand All @@ -144,7 +145,7 @@ my_bool MADB_ReadDSN(MADB_Dsn *Dsn, char *KeyValue, my_bool OverWrite)
Dsn->DSNName= _strdup(Value);
while (DsnKeys[i].DsnKey)
{
if (SQLGetPrivateProfileString(Dsn->DSNName, DsnKeys[i].DsnKey, NULL, KeyVal, 1024, "ODBC.INI") > 0)
if (SQLGetPrivateProfileString(Dsn->DSNName, DsnKeys[i].DsnKey, "", KeyVal, 1024, "ODBC.INI") > 0)
{
if (!MADB_DsnStoreValue(Dsn, DsnKeys[i].DsnOffset, KeyVal, DsnKeys[i].Type, OverWrite))
return FALSE;
Expand Down

0 comments on commit 0cfdfd7

Please sign in to comment.