#define FALSE ((BOOL)0)
#endif
-#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#else
-#define MAXPATHLEN 255
-#endif
DWORD
GetPrivateProfileString(char *theSection, // section name
size_t theReturnBufferLength, // byte length of return buffer
char *theIniFileName) // pathname of ini file to search
{
- char buf[MAXPATHLEN+1];
+ char buf[MAXPGPATH];
char* ptr = 0;
FILE* aFile = 0;
size_t aLength;
if( ptr == NULL)
{
- if( MAXPATHLEN < j )
- theIniFileName[MAXPATHLEN] = '\0';
+ if( MAXPGPATH-1 < j )
+ theIniFileName[MAXPGPATH-1] = '\0';
sprintf(buf,"%s",theIniFileName);
}
* the file won't be found and thus the default value will be
* returned.
*/
- if( MAXPATHLEN < strlen(ptr) + j )
+ if( MAXPGPATH-1 < strlen(ptr) + j )
{
- if( MAXPATHLEN < strlen(ptr) )
- ptr[MAXPATHLEN] = '\0';
+ if( MAXPGPATH-1 < strlen(ptr) )
+ ptr[MAXPGPATH-1] = '\0';
else
- theIniFileName[MAXPATHLEN-strlen(ptr)] = '\0';
+ theIniFileName[MAXPGPATH-1-strlen(ptr)] = '\0';
}
sprintf( buf, "%s/%s",ptr,theIniFileName );
char *theBuffer, // input buffer
char *theIniFileName) // pathname of ini file to write
{
- char buf[MAXPATHLEN+1];
+ char buf[MAXPGPATH];
char* ptr = 0;
FILE* aFile = 0;
size_t aLength;
if( ptr == NULL)
{
- if( MAXPATHLEN < j )
- theIniFileName[MAXPATHLEN] = '\0';
+ if( MAXPGPATH-1 < j )
+ theIniFileName[MAXPGPATH-1] = '\0';
sprintf(buf,"%s",theIniFileName);
}
// the file won't be found and thus the default value will be
// returned.
//
- if( MAXPATHLEN < strlen(ptr) + j )
+ if( MAXPGPATH-1 < strlen(ptr) + j )
{
- if( MAXPATHLEN < strlen(ptr) )
- ptr[MAXPATHLEN] = '\0';
+ if( MAXPGPATH-1 < strlen(ptr) )
+ ptr[MAXPGPATH-1] = '\0';
else
- theIniFileName[MAXPATHLEN-strlen(ptr)] = '\0';
+ theIniFileName[MAXPGPATH-1-strlen(ptr)] = '\0';
}
sprintf( buf, "%s/%s",ptr,theIniFileName );
// Constants ---------------------------------------------------------------
#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#define MAXPATHLEN (255+1) // Max path length
#define MAXKEYLEN (15+1) // Max keyword length
#define MAXDESC (255+1) // Max description length
#define MAXDSNAME (32+1) // Max data source name length
LPCSTR lpszStart;
char aszKey[MAXKEYLEN];
int cbKey;
-char value[MAXPATHLEN];
+char value[MAXPGPATH];
memset(&lpsetupdlg->ci, 0, sizeof(ConnInfo));
// lpsetupdlg->aAttr[iElement].fSupplied = TRUE;
- _fmemcpy(value, lpszStart, MIN(lpsz-lpszStart+1, MAXPATHLEN));
+ _fmemcpy(value, lpszStart, MIN(lpsz-lpszStart+1, MAXPGPATH));
mylog("aszKey='%s', value='%s'\n", aszKey, value);
{
if (hwndParent)
{
- char szBuf[MAXPATHLEN];
- char szMsg[MAXPATHLEN];
+ char szBuf[MAXPGPATH];
+ char szMsg[MAXPGPATH];
LoadString(s_hModule, IDS_BADDSN, szBuf, sizeof(szBuf));
wsprintf(szMsg, szBuf, lpszDSN);