mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-23 08:03:48 +01:00
Merge pull request #3157 from Master-Guy/issues/2462
Quick fix to prevent division by 0
This commit is contained in:
commit
12527c501a
@ -167,7 +167,7 @@ export function ls(
|
||||
|
||||
function postSegments(segments: string[], style?: any, linked?: boolean): void {
|
||||
const maxLength = Math.max(...segments.map((s) => s.length)) + 1;
|
||||
const filesPerRow = Math.floor(80 / maxLength);
|
||||
const filesPerRow = Math.ceil(80 / maxLength);
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
let row = "";
|
||||
for (let col = 0; col < filesPerRow; col++) {
|
||||
|
Loading…
Reference in New Issue
Block a user