Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/standard/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -5524,7 +5524,8 @@ PHP_FUNCTION(str_repeat)

while (e<ee) {
l = (e-s) < (ee-e) ? (e-s) : (ee-e);
memmove(e, s, l);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try using ```suggestion
like the codeblock language is "suggestion" ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, thx!I didn't know this trick! First time I've seen this. It's been ages since I used GitHub much. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very close! the last line got 3 indentation levels too many

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, your comment was created is on the deleted memmove line, can you re-create the comment on the added memcpy line?

/* src [s, s+l) and dst [e, e+l) cannot overlap: l <= e-s */
memcpy(e, s, l);
Comment thread
divinity76 marked this conversation as resolved.
e += l;
}
}
Expand Down
Loading