Skip to content

Commit adba504

Browse files
thg2kGirgias
authored andcommitted
ext/session: code cleanup - space after control flow keywords
1 parent 3b20ccd commit adba504

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

ext/session/mod_files.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static void ps_files_open(ps_files *data, /* const */ zend_string *key)
183183
#else
184184
/* Check to make sure that the opened file is not outside of allowable dirs.
185185
This is not 100% safe but it's hard to do something better without O_NOFOLLOW */
186-
if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf)) {
186+
if (PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf)) {
187187
return;
188188
}
189189
data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, data->filemode);
@@ -258,7 +258,7 @@ static zend_result ps_files_write(ps_files *data, zend_string *key, zend_string
258258
buf = wrote > -1 ? buf + wrote : 0;
259259
to_write = wrote > -1 ? SESS_FILE_BUF_SIZE(ZSTR_LEN(val) - n) : 0;
260260

261-
} while(wrote > 0);
261+
} while (wrote > 0);
262262
}
263263
#else
264264
n = write(data->fd, ZSTR_VAL(val), ZSTR_LEN(val));
@@ -508,7 +508,7 @@ PS_READ_FUNC(files)
508508
buf = read_in > -1 ? buf + read_in : 0;
509509
to_read = read_in > -1 ? SESS_FILE_BUF_SIZE(ZSTR_LEN(*val) - n) : 0;
510510

511-
} while(read_in > 0);
511+
} while (read_in > 0);
512512

513513
}
514514
#else
@@ -684,7 +684,7 @@ PS_CREATE_SID_FUNC(files)
684684
return NULL;
685685
}
686686
}
687-
} while(!sid);
687+
} while (!sid);
688688

689689
return sid;
690690
}

ext/session/mod_mm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ PS_CREATE_SID_FUNC(mm)
464464
return NULL;
465465
}
466466
}
467-
} while(!sid);
467+
} while (!sid);
468468

469469
return sid;
470470
}

ext/session/php_session.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ PHPAPI zend_result php_session_reset_id(void);
272272
} \
273273
} ZEND_HASH_FOREACH_END(); \
274274
zval_ptr_dtor(&_zv); \
275-
} while(0)
275+
} while (0)
276276

277277
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(ps)
278278

ext/session/session.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,12 +823,12 @@ static PHP_INI_MH(OnUpdateSessionDivisor)
823823
static PHP_INI_MH(OnUpdateRfc1867Freq)
824824
{
825825
int tmp = ZEND_ATOL(ZSTR_VAL(new_value));
826-
if(tmp < 0) {
826+
if (tmp < 0) {
827827
php_error_docref(NULL, E_WARNING, "session.upload_progress.freq must be greater than or equal to 0");
828828
return FAILURE;
829829
}
830-
if(ZSTR_LEN(new_value) > 0 && ZSTR_VAL(new_value)[ZSTR_LEN(new_value)-1] == '%') {
831-
if(tmp > 100) {
830+
if (ZSTR_LEN(new_value) > 0 && ZSTR_VAL(new_value)[ZSTR_LEN(new_value)-1] == '%') {
831+
if (tmp > 100) {
832832
php_error_docref(NULL, E_WARNING, "session.upload_progress.freq must be less than or equal to 100%%");
833833
return FAILURE;
834834
}
@@ -2577,7 +2577,7 @@ PHP_FUNCTION(session_start)
25772577
zend_argument_value_error(1, "must be of type array with keys as string");
25782578
RETURN_THROWS();
25792579
}
2580-
switch(Z_TYPE_P(value)) {
2580+
switch (Z_TYPE_P(value)) {
25812581
case IS_STRING:
25822582
case IS_TRUE:
25832583
case IS_FALSE:
@@ -3071,7 +3071,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
30713071

30723072
progress = PS(rfc1867_progress);
30733073

3074-
switch(event) {
3074+
switch (event) {
30753075
case MULTIPART_EVENT_START: {
30763076
const multipart_event_start *data = event_data;
30773077
progress = ecalloc(1, sizeof(php_session_rfc1867_progress));

0 commit comments

Comments
 (0)