Skip to content

Commit 5b0879e

Browse files
committed
Avoid trailing line break
1 parent a968453 commit 5b0879e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/opcache/zend_accelerator_module.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ static zval* accelerator_get_scripts(TSRMLS_D)
403403
for (i = 0; i<ZCSG(hash).max_num_entries; i++) {
404404
for (cache_entry = ZCSG(hash).hash_table[i]; cache_entry; cache_entry = cache_entry->next) {
405405
zend_persistent_script *script;
406+
char *str;
407+
int len;
406408

407409
if (cache_entry->indirect) continue;
408410

@@ -414,7 +416,10 @@ static zval* accelerator_get_scripts(TSRMLS_D)
414416
add_assoc_long(persistent_script_report, "hits", script->dynamic_members.hits);
415417
add_assoc_long(persistent_script_report, "memory_consumption", script->dynamic_members.memory_consumption);
416418
ta = localtime(&script->dynamic_members.last_used);
417-
add_assoc_string(persistent_script_report, "last_used", asctime(ta), 1);
419+
str = asctime(ta);
420+
len = strlen(str);
421+
if (len > 0 && str[len - 1] == '\n') len--;
422+
add_assoc_stringl(persistent_script_report, "last_used", str, len, 1);
418423
add_assoc_long(persistent_script_report, "last_used_timestamp", script->dynamic_members.last_used);
419424
if (ZCG(accel_directives).validate_timestamps) {
420425
add_assoc_long(persistent_script_report, "timestamp", (long)script->timestamp);

0 commit comments

Comments
 (0)