diff options
author | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
commit | 1f457376b478257b88d4a857f5ec1b6155442dd7 (patch) | |
tree | 2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/dk4strmh.ctr | |
parent | ac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff) |
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/dk4strmh.ctr')
-rw-r--r-- | support/dktools/dk4strmh.ctr | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/support/dktools/dk4strmh.ctr b/support/dktools/dk4strmh.ctr index 05df699e2f..cddea77248 100644 --- a/support/dktools/dk4strmh.ctr +++ b/support/dktools/dk4strmh.ctr @@ -2,7 +2,7 @@ copyright owner = Dirk Krause copyright year = 2015-xxxx -license = bsd +SPDX-License-Identifier: BSD-3-Clause @@ -14,13 +14,21 @@ license = bsd */ #ifndef DK4CONF_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" +#else +#include <dktools-4/dk4conf.h> +#endif #endif #if DK4_ON_WINDOWS #ifndef DK4TYPES_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4types.h" +#else +#include <dktools-4/dk4types.h> +#endif #endif #ifndef WINDOWS_H_INCLUDED @@ -29,11 +37,19 @@ license = bsd #endif #ifndef DK4ERROR_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4error.h" +#else +#include <dktools-4/dk4error.h> +#endif #endif #ifndef DK4STRM_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4strm.h" +#else +#include <dktools-4/dk4strm.h> +#endif #endif #ifndef STDIO_H_INCLUDED @@ -156,17 +172,21 @@ dk4stream_windows_handle_static_function(dk4_stream_api_t *api, int wc) } } break; case DK4_STREAM_API_WRITE : { - if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)(api->sz_in)) { - dwi = (DWORD)(api->sz_in); - dwo = (DWORD)0UL; - if (WriteFile(sh->ha, api->b, dwi, &dwo, NULL)) { - api->sz_out = dwo; - if (dwo == dwi) { - api->res = 1; + if (0 < api->sz_in) { + if ((dk4_um_t)0xFFFFFFFFUL >= (dk4_um_t)(api->sz_in)) { + dwi = (DWORD)(api->sz_in); + dwo = (DWORD)0UL; + if (WriteFile(sh->ha, api->b, dwi, &dwo, NULL)) { + api->sz_out = dwo; + if (dwo == dwi) { + api->res = 1; + } } + } else { + /* ERROR: Size too large */ } } else { - /* ERROR: Size too large */ + api->res = 1; } } break; case DK4_STREAM_API_FLUSH : { |