Commit 67279f8abcc73f35c546ad46fea41ac94de09ee5
1 parent
68b91b26
Exists in
master
and in
5 other branches
Testando interface hllapi
Showing
3 changed files
with
22 additions
and
3 deletions
Show diff stats
src/plugins/remotectl/hllapi.c
| ... | ... | @@ -208,6 +208,24 @@ |
| 208 | 208 | if(result && length && *length && str) |
| 209 | 209 | strncpy(str,strerror(result),*length); |
| 210 | 210 | |
| 211 | + str[*length] = 0; | |
| 212 | + | |
| 213 | +#ifdef DEBUG | |
| 214 | + { | |
| 215 | + FILE *arq = fopen("hllapi.dbg","a"); | |
| 216 | + char *ptr; | |
| 217 | + | |
| 218 | + for(ptr=str;*ptr;ptr++) | |
| 219 | + { | |
| 220 | + if(*ptr == ' ') | |
| 221 | + *ptr = '.'; | |
| 222 | + } | |
| 223 | + | |
| 224 | + fprintf(arq,"func: %ld\nresult: %d\nrc: %d\nLength: %d\nstring: [%s]\n",*func,result,*rc, *length, str); | |
| 225 | + fclose(arq); | |
| 226 | + } | |
| 227 | +#endif // DEBUG | |
| 228 | + | |
| 211 | 229 | free(arg); |
| 212 | 230 | return result; |
| 213 | 231 | } | ... | ... |
src/plugins/remotectl/remotectl.c
src/plugins/remotectl/testprogram.c
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | #include <stdio.h> |
| 32 | 32 | #include <pw3270/hllapi.h> |
| 33 | 33 | |
| 34 | - #define BUFFER_LENGTH 4096 | |
| 34 | + #define BUFFER_LENGTH 8000 | |
| 35 | 35 | |
| 36 | 36 | /*---[ Implement ]--------------------------------------------------------------------------------*/ |
| 37 | 37 | |
| ... | ... | @@ -68,8 +68,8 @@ |
| 68 | 68 | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - len = BUFFER_LENGTH; | |
| 72 | - rc = 1; | |
| 71 | + len = 80; | |
| 72 | + rc = 1040; | |
| 73 | 73 | fn = HLLAPI_CMD_COPYPSTOSTR; |
| 74 | 74 | result = hllapi(&fn,buffer,&len,&rc); |
| 75 | 75 | printf("%s exits with result=%d rc=%d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",result,rc,buffer); | ... | ... |