Commit 038462269945979956f2ae3d7b8124a95873b472
1 parent
530bea62
Exists in
master
and in
1 other branch
Fixing windows build.
Showing
4 changed files
with
6 additions
and
4 deletions
Show diff stats
src/core/calls.cc
src/core/get.cc
... | ... | @@ -112,7 +112,7 @@ |
112 | 112 | |
113 | 113 | return get([offset,buffer,len](TN3270::Host &host) { |
114 | 114 | |
115 | - string contents = host.toString((int) offset, (size_t) len); | |
115 | + string contents = host.toString((int) offset, (int) len); | |
116 | 116 | |
117 | 117 | memset(buffer,' ',len); |
118 | 118 | strncpy((char *) buffer, contents.c_str(), std::min((size_t) len,contents.size())); | ... | ... |
src/core/hllapi.cc
... | ... | @@ -250,7 +250,7 @@ static int search_ps(char *buffer, unsigned short *length, unsigned short *ps) { |
250 | 250 | if(!host.isConnected()) |
251 | 251 | return HLLAPI_STATUS_DISCONNECTED; |
252 | 252 | |
253 | - string contents = host.toString(0,-1,0); | |
253 | + string contents = host.toString(0,-1, '\0'); | |
254 | 254 | |
255 | 255 | if( ((size_t) *ps) >= contents.size()) |
256 | 256 | return HLLAPI_STATUS_BAD_POSITION; |
... | ... | @@ -305,7 +305,7 @@ static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) { |
305 | 305 | if(!host.isConnected()) |
306 | 306 | return HLLAPI_STATUS_DISCONNECTED; |
307 | 307 | |
308 | - string contents = host.toString(0,-1,0); | |
308 | + string contents = host.toString(0,-1,'\0'); | |
309 | 309 | |
310 | 310 | size_t szBuffer = std::min(contents.size(), ((size_t) *length)); |
311 | 311 | *length = (unsigned short) szBuffer; | ... | ... |
src/core/tools.cc
... | ... | @@ -77,7 +77,9 @@ |
77 | 77 | } translate[] = { |
78 | 78 | { ENOTCONN, HLLAPI_STATUS_DISCONNECTED }, |
79 | 79 | { ECONNRESET, HLLAPI_STATUS_DISCONNECTED }, |
80 | +#ifndef _WIN32 | |
80 | 81 | { EHOSTDOWN, HLLAPI_STATUS_DISCONNECTED }, |
82 | +#endif // !_WIN32 | |
81 | 83 | { EINVAL, HLLAPI_STATUS_BAD_PARAMETER }, |
82 | 84 | { ETIMEDOUT, HLLAPI_STATUS_TIMEOUT }, |
83 | 85 | { EBUSY, HLLAPI_STATUS_TIMEOUT }, | ... | ... |