diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-06-03 10:25:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-03 15:08:19 +0200 |
commit | 9c130462fd9b3515c3c71428bfc109285ed6ea0b (patch) | |
tree | 4c2968efc7f60d3025a5dd75013050121eef7a6c /desktop/unx/source/start.c | |
parent | 613467237fa2e9fe7c816d00127db9951c869c13 (diff) |
Improve some C code mixing size_t and ssize_t
Change-Id: I9b6082f3e913a9bddcb3bd035b92e829f9b00c07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135340
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop/unx/source/start.c')
-rw-r--r-- | desktop/unx/source/start.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index a83db69e5c66..f959565665cc 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -471,13 +471,14 @@ static sal_Bool send_args(int fd, rtl_uString const *pCwdPath) } nLen = rtl_string_getLength(pOut) + 1; - bResult = (write(fd, rtl_string_getStr(pOut), nLen) == (ssize_t) nLen); + ssize_t n = write(fd, rtl_string_getStr(pOut), nLen); + bResult = (n >= 0 && (size_t) n == nLen); if ( bResult ) { char resp[SAL_N_ELEMENTS("InternalIPC::ProcessingDone")]; - ssize_t n = read(fd, resp, SAL_N_ELEMENTS(resp)); - bResult = n == (ssize_t) SAL_N_ELEMENTS(resp) + n = read(fd, resp, SAL_N_ELEMENTS(resp)); + bResult = n == SAL_N_ELEMENTS(resp) && (memcmp( resp, "InternalIPC::ProcessingDone", SAL_N_ELEMENTS(resp)) |