- In PHP we're supposed to only use MAXPATHLEN (defined in php.h)

This commit is contained in:
Andi Gutmans 2000-12-16 20:56:44 +00:00
parent 86a1cace27
commit 8518010945

View File

@ -44,13 +44,9 @@
#define DBM_DATA dba_dbm_data *dba = info->dbf
#define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
#ifndef PATH_MAX
#define PATH_MAX 255
#endif
#define TRUNC_IT(extension, mode) \
snprintf(buf, PATH_MAX, "%s" extension, info->path); \
buf[PATH_MAX] = '\0'; \
snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \
buf[MAXPATHLEN-1] = '\0'; \
if((fd = V_OPEN((buf, O_CREAT | mode | O_WRONLY, filemode))) == -1) \
return FAILURE; \
close(fd);
@ -71,7 +67,7 @@ DBA_OPEN_FUNC(dbm)
}
if(info->mode == DBA_TRUNC) {
char buf[PATH_MAX + 1];
char buf[MAXPATHLEN];
/* dbm/ndbm original */
TRUNC_IT(".pag", O_TRUNC);
@ -79,7 +75,7 @@ DBA_OPEN_FUNC(dbm)
}
if(info->mode == DBA_CREAT) {
char buf[PATH_MAX + 1];
char buf[MAXPATHLEN];
TRUNC_IT(".pag", 0);
TRUNC_IT(".dir", 0);