summaryrefslogtreecommitdiff
path: root/main/fopen_wrappers.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/fopen_wrappers.c')
-rw-r--r--main/fopen_wrappers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index b9cf243792..badbce3f60 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -561,7 +561,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
location[0] = '\0';
if (!SOCK_FEOF(*socketd)) {
/* get response header */
- if (SOCK_FGETS(tmp_line, sizeof(tmp_line), *socketd) != NULL) {
+ if (SOCK_FGETS(tmp_line, sizeof(tmp_line)-1, *socketd) != NULL) {
if (strncmp(tmp_line + 8, " 200 ", 5) == 0) {
reqok = 1;
}
@@ -569,7 +569,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
}
/* Read past HTTP headers */
while (!body && !SOCK_FEOF(*socketd)) {
- if (SOCK_FGETS(tmp_line, sizeof(tmp_line), *socketd) != NULL) {
+ if (SOCK_FGETS(tmp_line, sizeof(tmp_line)-1, *socketd) != NULL) {
char *p = tmp_line;
tmp_line[sizeof(tmp_line)-1] = '\0';
@@ -760,7 +760,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
/* set up the passive connection */
SOCK_WRITE("PASV\n", *socketd);
- while (SOCK_FGETS(tmp_line, sizeof(tmp_line), *socketd) &&
+ while (SOCK_FGETS(tmp_line, sizeof(tmp_line)-1, *socketd) &&
!(isdigit((int) tmp_line[0]) && isdigit((int) tmp_line[1]) &&
isdigit((int) tmp_line[2]) && tmp_line[3] == ' '));
@@ -923,7 +923,7 @@ int _php3_getftpresult(int socketd)
{
char tmp_line[513];
- while (SOCK_FGETS(tmp_line, sizeof(tmp_line), socketd) &&
+ while (SOCK_FGETS(tmp_line, sizeof(tmp_line)-1, socketd) &&
!(isdigit((int) tmp_line[0]) && isdigit((int) tmp_line[1]) &&
isdigit((int) tmp_line[2]) && tmp_line[3] == ' '));