[php-src] PR #18738: Update strlcat.c
| From: | itashia | Date: | Mon, 02 Jun 2025 11:46:01 +0000 |
| Subject: | [php-src] PR #18738: Update strlcat.c | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-31927@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/18738
Author: itashia
Refactor: Improve variable naming, loop clarity, and safety
- Renamed variables for better clarity (e.g.,
n → remaining,
orig_dst/orig_src for start pointers)
- Optimized loops by removing unnecessary operations
- Replaced n != 0 with remaining > 1 for clearer loop conditions
- Added clearer comments and documentation for function behavior
- Grouped related code blocks for better structure
- Removed unnecessary temporary variables
- Ensured null-termination (\0) to prevent buffer overflows
- All performance characteristics and original algorithm logic preserved