Skip to content

Commit 9d1b814

Browse files
committed
Fix: remove carriage return in concatenated files for routes
1 parent db663af commit 9d1b814

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ Change Log
404404
* Fix: TCP reconnect back to whois server if connection drops (@tallwireless)
405405
* Fix: irrpt_list_ases did not include ASNs which had a single prefix
406406
* Fix: readme cleanup
407+
* Fix: Removed extra carriage return in concatenated files
407408
* Chg: Required PHP version bumped from 5.4 to 7.2
408409

409410

inc/utils.inc

+4-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ function check_file_perms($file_name) {
5353

5454
/* concatenates srcFile1 and srcFile2 to dstFile */
5555
function concat_files($src_file1, $src_file2, $dst_file) {
56+
status(STATUS_DEBUG, "Concatinating files $src_file1 + $src_file2 = $dst_file");
5657
$content_file1 = $content_file2 = null;
5758

58-
if (!$dst_fp = fopen("$dst_file", 'w+')) {
59+
if (!$dst_fp = @fopen("$dst_file", 'w+')) {
5960
status(STATUS_ERROR, "Error: Unable to open $dst_file for writing, aborting.");
6061
return(FALSE);
6162
}
@@ -74,11 +75,11 @@ function concat_files($src_file1, $src_file2, $dst_file) {
7475
status(STATUS_INFO, "Warning: Unable to read $src_file1.");
7576
}
7677

77-
if (fwrite($dst_fp, "$content_file1\n") === FALSE) {
78+
if (@fwrite($dst_fp, $content_file1) === FALSE) {
7879
status(STATUS_INFO, "Warning: File content $src_file1 not written to $dst_file.");
7980
}
8081

81-
if (fwrite($dst_fp, $content_file2) === FALSE) {
82+
if (@fwrite($dst_fp, $content_file2) === FALSE) {
8283
status(STATUS_INFO, "Warning: File content $src_file2 not written to $dst_file.");
8384
}
8485

0 commit comments

Comments
 (0)