[GIT-PULLS] [php-src] PR #23426: sapi/lsapi: fix sapi_lsapi_ub_write() return value on short write

[email protected] (lazerg)
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/23426
Author: lazerg

`sapi_lsapi_ub_write()` returns `str_length - ret` when `LSAPI_Write()` writes fewer bytes than requested. `LSAPI_Write()` already returns the number of bytes it wrote (`LSAPI_Write_r()` in lsapilib.c returns `p - pBuf`, or -1 on error), the same contract every other `ub_write` in this codebase follows, e.g. `sapi_cli_ub_write()` returns `ptr - str`. Subtracting that count from `str_length` gives the wrong value. Return `ret` instead.

Fixes #23424
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.